Permalink
Browse files

Changed the type of the gesture recognizer action block to parameter …

…to id to remove the need to cast it in the block.
  • Loading branch information...
1 parent 3e6d1f0 commit 2e8b7dca78a8743eed471bdad947ab3d005bc227 @neror committed Mar 8, 2011
Showing with 3 additions and 5 deletions.
  1. +2 −4 Examples/GestureRecognizerBlocks.m
  2. +1 −1 Headers/FTUtils/FTUtils+UIGestureRecognizer.h
@@ -39,8 +39,7 @@ - (void)viewDidLoad {
#if NS_BLOCKS_AVAILABLE
[self.viewToAnimate addGestureRecognizer:
- [UIPanGestureRecognizer recognizerWithActionBlock:^(UIGestureRecognizer *recognizer) {
- UIPanGestureRecognizer *pan = (UIPanGestureRecognizer *)recognizer;
+ [UIPanGestureRecognizer recognizerWithActionBlock:^(UIPanGestureRecognizer *pan) {
if(pan.state == UIGestureRecognizerStateBegan ||
pan.state == UIGestureRecognizerStateChanged) {
CGPoint translation = [pan translationInView:self.viewToAnimate.superview];
@@ -52,8 +51,7 @@ - (void)viewDidLoad {
}]];
UIPinchGestureRecognizer *thePinch = [UIPinchGestureRecognizer recognizer];
- thePinch.actionBlock = ^(UIGestureRecognizer *recognizer) {
- UIPinchGestureRecognizer *pinch = (UIPinchGestureRecognizer *)recognizer;
+ thePinch.actionBlock = ^(UIPinchGestureRecognizer *pinch) {
if ([pinch state] == UIGestureRecognizerStateBegan ||
[pinch state] == UIGestureRecognizerStateChanged) {
self.viewToAnimate.transform = CGAffineTransformScale(self.viewToAnimate.transform, pinch.scale, pinch.scale);
@@ -24,7 +24,7 @@
#if NS_BLOCKS_AVAILABLE
-typedef void (^FTUIGestureActionBlock)(UIGestureRecognizer *recognizer);
+typedef void (^FTUIGestureActionBlock)(id recognizer);
@interface UIGestureRecognizer(FTBlockAdditions)

0 comments on commit 2e8b7dc

Please sign in to comment.