Label TapGesture, as Buttun Function

import UIKit


class ViewControllerr: UIViewController {
...... 
override func viewDidLoad() {
 
        let tap = UITapGestureRecognizer(target: self, action: #selector(PengajuanAsuransiViewController.tapFunction))
        labelAccept.isUserInteractionEnabled = true
        labelAccept.addGestureRecognizer(tap)
    }

@objc func tapFunction(sender:UITapGestureRecognizer) {
        print("tap working")
    }
}

No comments: