Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions RESideMenu/RESideMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ @interface RESideMenu ()
@property (strong, readwrite, nonatomic) UIView *menuViewContainer;
@property (strong, readwrite, nonatomic) UIView *contentViewContainer;
@property (assign, readwrite, nonatomic) BOOL didNotifyDelegate;
@property (strong, readwrite, nonatomic) UIPanGestureRecognizer *panGestureRecognizer;

@end

Expand Down Expand Up @@ -237,10 +238,7 @@ - (void)viewDidLoad
[self addMenuViewControllerMotionEffects];

if (self.panGestureEnabled) {
self.view.multipleTouchEnabled = NO;
UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognized:)];
panGestureRecognizer.delegate = self;
[self.view addGestureRecognizer:panGestureRecognizer];
[self configurePanGestureRecognizer];
}

[self updateContentViewShadow];
Expand Down Expand Up @@ -474,6 +472,15 @@ - (void)resetContentViewScale
self.contentViewContainer.frame = frame;
}

- (void)configurePanGestureRecognizer
{
self.view.multipleTouchEnabled = NO;
UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognized:)];
panGestureRecognizer.delegate = self;
[self.view addGestureRecognizer:panGestureRecognizer];
self.panGestureRecognizer = panGestureRecognizer;
}

#pragma mark -
#pragma mark iOS 7 Motion Effects (Private)

Expand Down Expand Up @@ -774,6 +781,17 @@ - (void)setRightMenuViewController:(UIViewController *)rightMenuViewController
[self.view bringSubviewToFront:self.contentViewContainer];
}

- (void)setPanGestureEnabled:(BOOL)enabled
{
_panGestureEnabled = enabled;

if (self.panGestureRecognizer) {
self.panGestureRecognizer.enabled = enabled;
} else {
[self configurePanGestureRecognizer];
}
}

#pragma mark -
#pragma mark View Controller Rotation handler

Expand Down