[英]iOS: How to write handler for Tap Gesture Recognizer if dragged in from storyboard?
將手勢識別器作為插座連接到ViewController和viewDidLoad中:
[self.yourGesture addTarget:self action:@selector(didTapOnImage:)] ;
然后聲明您的方法didTapOnImage方法:
-(void)didTapOnImage:(UIGestureRecognizer*) recognizer
{
//do your work here
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.