4

This might sound like a weird request but I've been using the AMSlideMenu (which is fantastic) https://github.com/SocialObjects-Software/AMSlideMenu

But on one of my specific projects I need to be able to open the left side menu only using a button.

Now I have a button that's currently working to open and close the menu, but for this specific project I need to use swipe gestures, so I would need to disable accessing the menu via swipes.

I've been looking at the methods that are within the AMSlideMenu files, but I can't figure out how to disable the swiping.

Any help would be greatly appreciated!

arturdev
  • 10,884
  • 2
  • 39
  • 67
PhilBlais
  • 1,076
  • 4
  • 13
  • 36

1 Answers1

5

If you've read the documentation in the link, you could notice they stated that you have to import "UIViewController+AMSlideMenu.h" on your pushed view controller and then call [self disableSlidePanGestureForLeftMenu]; on your viewDidLoad method (or wherever you want). I've tried it with the example they've provided and it works.

enter image description here

Update:
For iOS 8+ you should call this method on viewWillAppear and not viewDidLoad as mentioned here.

Marcel Hofgesang
  • 951
  • 1
  • 15
  • 36
GenieWanted
  • 4,473
  • 4
  • 24
  • 35
  • 1
    For iOS 8 and 8+ you should call this method on viewWillAppear and not viewDidLoad (tested and working). Source: https://github.com/SocialObjects-Software/AMSlideMenu/issues/115 – Legnus Feb 14 '17 at 17:15