- Added a property to be able ti turn swipe gesture off/on

- SlideMenu enables swipe on default
This commit is contained in:
Aryan Gh 2013-05-12 19:08:18 -07:00
parent 513ab6a07f
commit 0d1d53ce27
2 changed files with 17 additions and 1 deletions

View File

@ -23,6 +23,7 @@ typedef enum{
@interface SlideNavigationController : UINavigationController <UINavigationControllerDelegate>
@property (nonatomic, assign) BOOL avoidSwitchingToSameClassViewController;
@property (nonatomic, assign) BOOL enableSwipeGesture;
@property (nonatomic, strong) UIViewController *righMenu;
@property (nonatomic, strong) UIViewController *leftMenu;
@property (nonatomic, strong) UIBarButtonItem *leftbarButtonItem;

View File

@ -22,6 +22,7 @@
@synthesize draggingPoint;
@synthesize leftbarButtonItem;
@synthesize rightBarButtonItem;
@synthesize enableSwipeGesture;
#define MENU_OFFSET 60
#define MENU_SLIDE_ANIMATION_DURATION .3
@ -75,7 +76,7 @@ static SlideNavigationController *singletonInstance;
self.view.layer.shouldRasterize = YES;
self.view.layer.rasterizationScale = [UIScreen mainScreen].scale;
[self.view addGestureRecognizer:self.panRecognizer];
[self setEnableSwipeGesture:YES];
}
#pragma mark - Public Methods -
@ -428,4 +429,18 @@ static SlideNavigationController *singletonInstance;
return panRecognizer;
}
- (void)setEnableSwipeGesture:(BOOL)markEnableSwipeGesture
{
enableSwipeGesture = markEnableSwipeGesture;
if (enableSwipeGesture)
{
[self.view addGestureRecognizer:self.panRecognizer];
}
else
{
[self.view removeGestureRecognizer:self.panRecognizer];
}
}
@end