[Objective-C] Objective c在UIViewController中加入点击触摸事件 →→→→→进入此内容的聊天室

来自 , 2019-06-20, 写在 Objective-C, 查看 133 次.
URL http://www.code666.cn/view/860b37e2
  1. //The setup code (in viewDidLoad in your view controller)
  2. UITapGestureRecognizer *singleFingerTap =
  3.   [[UITapGestureRecognizer alloc] initWithTarget:self
  4.                                           action:@selector(handleSingleTap:)];
  5. [self.view addGestureRecognizer:singleFingerTap];
  6. [singleFingerTap release];
  7.  
  8. //The event handling method
  9. - (void)handleSingleTap:(UITapGestureRecognizer *)recognizer {
  10.   CGPoint location = [recognizer locationInView:[recognizer.view superview]];
  11.  
  12.   //Do stuff here...
  13. }
  14. //objectc/5096

回复 "Objective c在UIViewController中加入点击触摸事件"

这儿你可以回复上面这条便签

captcha