Reputation: 1532
I am working on an app which uses ECSlidingViewController to implement a drawer menu.
I need to keep the menu always open on the home screen but keep it hidden and only open it on swipe when I am on the other views.
Does the lib allow that kind of behaviour ?
Any advice is welcome.
Thank you in advance
Upvotes: 0
Views: 166
Reputation: 1532
I've found the solution (which was quite easy actually)
Opening the sliding menu at startup
self.slidingViewController().anchorTopViewToRightAnimated(true);
Disabling gestures on the menu
self.slidingViewController().panGesture.enabled = false;
(you should set this to true again when you change view and need the menu to respond to gestures)
There is just one problem, I can't make anchorTopViewToRightAnimated
work after I change topView.
Any ideas why ?
EDIT:
I'm calling anchorTopViewToRightAnimated
in viewDidAppear -> not working (after viewChange)
If I try to call that method on button click it works fine, so it must be that ECSlidingView isn't ready or smthg like that but as there are no notifications or whatsoever I can't know when to call the method.
I could subclass ECSlidingViewController
but would rather avoid it if possible
Upvotes: 1