Skip to content

Instantly share code, notes, and snippets.

@imnaveensharma
Last active July 24, 2020 05:09
Show Gist options
  • Save imnaveensharma/a074d7589d138fc701faee8694090304 to your computer and use it in GitHub Desktop.
Save imnaveensharma/a074d7589d138fc701faee8694090304 to your computer and use it in GitHub Desktop.
Enable user interaction on UILabel by UITapGestureRecognizer
private func makeLabelClickable() {
self.label.isUserInteractionEnabled = true
let guestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(labelClicked(_:)))
self.label.addGestureRecognizer(guestureRecognizer)
}
@objc func labelClicked(_ sender: Any) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment