iDevelopper / PBRevealViewController

A UIViewController subclass for revealing a left and/or right view controller above or below a main view controller.
MIT License
80 stars 16 forks source link

How to enable disable opening Left menu feature on UIViewControllers. #83

Closed shashi-kiwi closed 4 years ago

shashi-kiwi commented 4 years ago

HI @iDevelopper I dont want to open left menu on some UIViewcontrollers. Currently it is allowing to do by swipe left or pan gesture on all the Viewcontrollers.

Can u please help me how to achieve this? Thanks inadvance.

iDevelopper commented 4 years ago

Hello,

Use the delegate method (for example):

    func revealControllerPanGestureShouldBegin(_ revealController: PBRevealViewController, direction: PBRevealControllerPanDirection) -> Bool
    {
        if let nc = revealController.mainViewController as? UINavigationController, nc.topViewController is MainViewController, direction == .right {
            return false
        }
        return true
    }