Permalink
Browse files

Added a third gesture to the GestureRecognizerBlocks example showing …

…the effects of setting the actionBlock to nil.
  • Loading branch information...
1 parent d448fe9 commit ddd7271e4ccd94da709a9f8d154b0fe5ea2ca10f @neror committed Mar 12, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 Examples/GestureRecognizerBlocks.m
@@ -60,6 +60,15 @@ - (void)viewDidLoad {
};
[self.viewToAnimate addGestureRecognizer:thePinch];
+ UITapGestureRecognizer *doubleTap = [UITapGestureRecognizer recognizerWithActionBlock:^(id dTap) {
+ thePinch.actionBlock = nil;
+ [UIView animateWithDuration:.25f animations:^{
+ self.viewToAnimate.transform = CGAffineTransformIdentity;
+ }];
+ }];
+ doubleTap.numberOfTapsRequired = 2;
+ [self.viewToAnimate addGestureRecognizer:doubleTap];
+
#endif
}

0 comments on commit ddd7271

Please sign in to comment.