From 2d51ddcc31304db226a737c815acd1447ee6718e Mon Sep 17 00:00:00 2001 From: Joan Lluch Date: Thu, 12 Jun 2014 00:27:27 +0200 Subject: [PATCH] gesture recognizer delegates --- RevealControllerStoryboardExample/.DS_Store | Bin 6148 -> 6148 bytes .../project.pbxproj | 6 +- .../en.lproj/MainStoryboard-iPad.storyboard | 102 +++++++----------- .../en.lproj/MainStoryboard.storyboard | 62 +++++------ .../SWRevealViewController.h | 12 ++- .../SWRevealViewController.m | 10 +- 6 files changed, 84 insertions(+), 108 deletions(-) diff --git a/RevealControllerStoryboardExample/.DS_Store b/RevealControllerStoryboardExample/.DS_Store index 4f44c927374a1e2ba26ae6080fc3ac6da80b0a9c..2f34dfff9dd2b878689d1edde80ea92744b2aeb9 100644 GIT binary patch delta 44 vcmZoMXffDO!o-+5`94!DkBdu6X-P5z!};zRe<$B#N@IaCVm2>fP7nbAg@Y1e delta 45 wcmZoMXffDO!o*ZqIr#xo43CRTN@+ - + - - - + + + + + + - + @@ -28,35 +31,27 @@ - - + + - + - - - - - - - + @@ -65,27 +60,19 @@ - + - - - - - - - + @@ -94,27 +81,19 @@ - + - - - - - - - + @@ -123,11 +102,10 @@ - + - - + @@ -144,26 +122,27 @@ + + + + - + - - - - - - + + @@ -192,26 +171,25 @@ + + + + - + - - + + - - - - - - - + + @@ -225,7 +203,7 @@ - + diff --git a/RevealControllerStoryboardExample/RevealControllerStoryboardExample/en.lproj/MainStoryboard.storyboard b/RevealControllerStoryboardExample/RevealControllerStoryboardExample/en.lproj/MainStoryboard.storyboard index c8eae2d..7ed4d24 100755 --- a/RevealControllerStoryboardExample/RevealControllerStoryboardExample/en.lproj/MainStoryboard.storyboard +++ b/RevealControllerStoryboardExample/RevealControllerStoryboardExample/en.lproj/MainStoryboard.storyboard @@ -1,9 +1,8 @@ - + - - - + + @@ -39,11 +38,11 @@ - + - + @@ -58,28 +57,25 @@ + + + + - + - - - - - - + @@ -95,27 +91,26 @@ - - + + - + - - - + @@ -124,20 +119,19 @@ - + - - + @@ -146,20 +140,19 @@ - + - - + @@ -168,11 +161,10 @@ - + - - + @@ -195,7 +187,7 @@ - + \ No newline at end of file diff --git a/SWRevealViewController/SWRevealViewController.h b/SWRevealViewController/SWRevealViewController.h index 0a00920..8103d94 100755 --- a/SWRevealViewController/SWRevealViewController.h +++ b/SWRevealViewController/SWRevealViewController.h @@ -28,7 +28,11 @@ RELEASE NOTES - Version 2.0.1 (Current Version) + Version 2.0.2 (Current Version) + + - Added new delegates for better control of gesture recognizers + + Version 2.0.1 - Fix: draggableBorderWidth now correctly handles the cases where one of the rear controllers is not provided - Fix: the shadow related properties are now granted at any time after view load, not just after initialization. @@ -287,10 +291,12 @@ typedef enum - (BOOL)revealControllerTapGestureShouldBegin:(SWRevealViewController *)revealController; // Implement this to return YES if you want this gesture recognizer to share touch events with the pan gesture -- (BOOL)revealControllerPanGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer; +- (BOOL)revealController:(SWRevealViewController *)revealController + panGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer; // Implement this to return YES if you want this gesture recognizer to share touch events with the tap gesture -- (BOOL)revealControllerTapGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer; +- (BOOL)revealController:(SWRevealViewController *)revealController + tapGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer; // Called when the gestureRecognizer began and ended - (void)revealControllerPanGestureBegan:(SWRevealViewController *)revealController; diff --git a/SWRevealViewController/SWRevealViewController.m b/SWRevealViewController/SWRevealViewController.m index 6403981..b2bc370 100755 --- a/SWRevealViewController/SWRevealViewController.m +++ b/SWRevealViewController/SWRevealViewController.m @@ -1075,24 +1075,26 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)recognizer return NO; } + - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { if ( gestureRecognizer == _panGestureRecognizer ) { - if ( [_delegate respondsToSelector:@selector(revealControllerPanGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:)] ) - if ( [_delegate revealControllerPanGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:otherGestureRecognizer] == YES ) + if ( [_delegate respondsToSelector:@selector(revealController:panGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:)] ) + if ( [_delegate revealController:self panGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:otherGestureRecognizer] == YES ) return YES; } if ( gestureRecognizer == _tapGestureRecognizer ) { - if ( [_delegate respondsToSelector:@selector(revealControllerTapGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:)] ) - if ( [_delegate revealControllerTapGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:otherGestureRecognizer] == YES ) + if ( [_delegate respondsToSelector:@selector(revealController:tapGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:)] ) + if ( [_delegate revealController:self tapGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:otherGestureRecognizer] == YES ) return YES; } return NO; } + - (BOOL)_tapGestureShouldBegin { if ( _frontViewPosition == FrontViewPositionLeft ||