Guest User

Untitled

a guest
Jul 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. - (void) panned:(UIPanGestureRecognizer *) recognizer {
  2. if (waitForSomething) {
  3. // cancel or reset the recognizer!
  4. // because the next event should be UIGestureRecognizerStateBegan and not UIGestureRecognizerStateChanged
  5. return;
  6. }
  7.  
  8. switch (recognizer.state) {
  9. case UIGestureRecognizerStateBegan:
  10. // important initialisation code
  11. break;
  12.  
  13. case UIGestureRecognizerStateChanged:
  14. // do something
  15. break;
  16. }
  17. }
  18.  
  19. if (waitForSomething) {
  20. recognizer.enabled = NO;
  21. recognizer.enabled = YES;
  22. return;
  23. }
Add Comment
Please, Sign In to add comment