ECSlidingViewController has methods for doing this: anchorTopViewToRightAnimated: anchorTopViewToLeftAnimated: and resetTopViewAnimated:
An example in your top level controller:
[self.slidingViewController anchorTopViewToRightAnimated:YES]
ECSlidingViewController provides a category for the UIViewController that adds this slidingViewController property.
You can also use ECSlidingViewController currentTopViewPosition to determine if your button should show your menu or hide it in the current context.
Kketch
source share