daily pastebin goal
35%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Setup gestureRecognizers
  2.     UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapListener:)];
  3.     tapRecognizer.numberOfTapsRequired = 1;
  4.     tapRecognizer.delegate = self;
  5.     [previewPort addGestureRecognizer:tapRecognizer];
  6.     [tapRecognizer release];
  7.  
  8.     UITapGestureRecognizer *dblTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dblTapListener:)];
  9.     dblTapRecognizer.numberOfTapsRequired = 2;
  10.     dblTapRecognizer.delegate = self;
  11.     [previewPort addGestureRecognizer:dblTapRecognizer];
  12.     [dblTapRecognizer release];
  13.  
  14.     UITapGestureRecognizer *triTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(triTapListener:)];
  15.     triTapRecognizer.numberOfTapsRequired = 3;
  16.     triTapRecognizer.delegate = self;
  17.     [previewPort addGestureRecognizer:triTapRecognizer];
  18.     [triTapRecognizer release];
  19.  
  20.     [tapRecognizer requireGestureRecognizerToFail:dblTapRecognizer];
  21.     [tapRecognizer requireGestureRecognizerToFail:triTapRecognizer];
  22.     [dblTapRecognizer requireGestureRecognizerToFail:triTapRecognizer];
  23.  
  24.  
  25.  
  26. .......
  27.  
  28.  
  29.  
  30. - (void)tapListener:(UIGestureRecognizer *)event {
  31.     NSLog(@"Single");
  32. }
  33.  
  34. - (void)dblTapListener:(UIGestureRecognizer *)event {
  35.     NSLog(@"Double");
  36. }
  37.  
  38. - (void)triTapListener:(UIGestureRecognizer *)event {
  39.     NSLog(@"Tri");
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top