RESideMenu icon indicating copy to clipboard operation
RESideMenu copied to clipboard

Pan gesture won't re-enable if panGestureEnabled is initially set to NO.

Open RyanTLX opened this issue 10 years ago • 1 comments

I have a project that launches with panGestureEnabled = NO if the user is not logged in, or panGestureEnabled = YES if the user is already logged in (I've also verified that the code goes to the correct path for my "isUserLoggedIn" condition).

In my rootViewController(RESideMenu), I've set the leftMenuViewController and contentViewController accordingly. I've also set panFromEdge = NO so that users can swipe from anywhere because I still wish to have the default iOS interactive pop gesture.

If panGestureEnabled is initially set to YES or not set at all, I can toggle this property YES and NO later and it will work as intended. Great!

However if panGestureEnabled is initially set to NO in the following places:

  • RootViewController's awakeFromNib
  • ContentViewController's viewWillAppear or even viewDidAppear,

I cannot get the swipe gesture to work anymore with panGestureEnabled = YES.

I have a demo project replicating this problem here.

Is there a solution to this problem? Thank you for your time and thumbs up for one of the first and best iOS 7 menu libraries out there! :)

RyanTLX avatar Jul 10 '14 19:07 RyanTLX

the issue is that RESideMenu inits pan gesture from ViewDidLoad and if panGestureEnabled = NO then it does not add it to its view. Always init contentViewController with panGestureEnabled = YES Use panGestureEnabled = NO in viewDidAppear in your contentViewController

sasnik avatar Nov 12 '15 12:11 sasnik