I'd like to implement my sliding menu in a way that pressing the Menu button will show my menu and pressing Menu again would hide it. But I can't understand how to do it with ECSlidingViewController. Will appreciate any help.
ECSlidingViewController has methods for this: anchorTopViewToRightAnimated:
, anchorTopViewToLeftAnimated:
and resetTopViewAnimated:
.
Example in your top view controller:
[self.slidingViewController anchorTopViewToRightAnimated:YES]
ECSlidingViewController provides a category for UIViewController adding this slidingViewController
property.
You may also want to use ECSlidingViewController's currentTopViewPosition
to determine if your button should show your menu or hide it in the current context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With