LoginSignup
0
2

More than 5 years have passed since last update.

一番簡単なラベルのタッチ処理 by Swift3

Posted at
    @IBOutlet weak var YourLabel: UILabel!
    override func viewDidLoad() {
        super.viewDidLoad()
        let tap = UITapGestureRecognizer(target: self, action: #selector(クラスの名前.tapFunction))
        YourLabel.isUserInteractionEnabled = true
        YourLabel.addGestureRecognizer(tap)
    }

    func tapFunction(sender:UITapGestureRecognizer) {
        print("tap working")
    }
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2