Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions RESideMenu/RESideMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

@interface RESideMenu : UIViewController <UIGestureRecognizerDelegate>

@property (strong, readwrite, nonatomic) UIViewController *contentViewController;
@property (strong, readwrite, nonatomic) UIViewController *leftMenuViewController;
@property (strong, readwrite, nonatomic) UIViewController *rightMenuViewController;
@property (strong, readwrite, nonatomic) IBOutlet UIViewController *contentViewController;
@property (strong, readwrite, nonatomic) IBOutlet UIViewController *leftMenuViewController;
@property (strong, readwrite, nonatomic) IBOutlet UIViewController *rightMenuViewController;
@property (weak, readwrite, nonatomic) id<RESideMenuDelegate> delegate;

@property (assign, readwrite, nonatomic) NSTimeInterval animationDuration;
Expand Down
13 changes: 11 additions & 2 deletions RESideMenu/RESideMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ @interface RESideMenu ()
@property (strong, readwrite, nonatomic) UIView *contentViewContainer;
@property (assign, readwrite, nonatomic) BOOL didNotifyDelegate;

@property (weak, nonatomic) UIPanGestureRecognizer *panGestureRecognizer;

@end

@implementation RESideMenu
Expand Down Expand Up @@ -216,7 +218,9 @@ - (void)viewDidLoad
self.view.multipleTouchEnabled = NO;
UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(__panGestureRecognized:)];
panGestureRecognizer.delegate = self;

[self.view addGestureRecognizer:panGestureRecognizer];
[self setPanGestureRecognizer:panGestureRecognizer];
}

[self __updateContentViewShadow];
Expand Down Expand Up @@ -474,6 +478,10 @@ - (void)__addContentViewControllerMotionEffects

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
if ([gestureRecognizer isEqual:self.panGestureRecognizer] && !self.panGestureEnabled) {
return NO;
}

IF_IOS7_OR_GREATER(
if (self.interactivePopGestureRecognizerEnabled && [self.contentViewController isKindOfClass:[UINavigationController class]]) {
UINavigationController *navigationController = (UINavigationController *)self.contentViewController;
Expand All @@ -483,11 +491,12 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceive
}
);

if (self.panFromEdge && [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && !self.visible) {
if (self.panFromEdge && [gestureRecognizer isEqual:self.panGestureRecognizer] && !self.visible) {
CGPoint point = [touch locationInView:gestureRecognizer.view];
if (point.x < 20.0 || point.x > self.view.frame.size.width - 20.0) {
return YES;
} else {
}
else {
return NO;
}
}
Expand Down