1
@IBOutlet weak var imageTitle: UILabel!
@IBOutlet weak var profileImage: UIImageView!
func titleStyle(){
imageTitle.layer.borderWidth = 1.0
imageTitle.layer.borderColor = UIColor.grayColor().CGColor
imageTitle.layer.cornerRadius = 10.0
// Apply Gesture to label
imageTitle.userInteractionEnabled = true
imageTitle.tag = 10
imageTitle.addGestureRecognizer(UIGestureRecognizer(target: self, action: "tappedLabel"))
}
一些如何在代码轻击标签时看起来不起作用。UILabel手势响应
func tappedLabel(gesture: UIGestureRecognizer){
print("Hi")
}
为什么不使用轻击手势识别器? – Wain