0

I am implemented MMDrawerController for my application when I clicking in the leftView cell I need to navigate to another view controller as a new controller ,but if I am pushing the view controller its opening in the same left view only its not open as a new vc.

if I given presentviewcontroller. its not navigate to child view of my vc.

please help me .

1 Answers1

0

Try this :

viewcontroller = Where you want to push the Screen..!

Make sure mmDrawerController (object of MMDrawerController() ) has viewControllers , here mmDrawerController means where I initialized it first time . Like in appDelegate or etc..

Check if it is nil or not: print(mmDrawerController.centerViewController)

@IBAction func btnTapped(sender:UIButton) {
        let viewcontroller = UIViewController()
        mmDrawerController.setCenterView(viewcontroller, withFullCloseAnimation: false, completion: nil)
    }
Er.Gopal Vasani
  • 448
  • 3
  • 12
  • Thank you ... I am getting my new VC as a new CenterViewController , my new VC is embedded with navihgationVC's navigation Bar not showing. When I click on button in new VC-- my application crashing . How to resolve this. –  Mar 04 '17 at 05:51
  • have you embeded your viewcontrollers with navigationController ?? try to check first that your navigationcontroller has viewcontrollers. – Er.Gopal Vasani Mar 04 '17 at 05:54
  • 1
    let say i have two ViewControllers , 1: LeftViewController and 2 : FrontViewController . now I initialized it in AppDelegate and assign their objects to two different navigationcontrollers and now i assigned that two navigationcontrollers object to MMDrawerController() , now next step is assign that object of MMDrawerController to one new navigationController , make that newlly navigationcontrollers object to window's rootViewController. – Er.Gopal Vasani Mar 04 '17 at 06:24
  • And when you want to push your screen anywhere , just follow my answer which i described in @IBAction. – Er.Gopal Vasani Mar 04 '17 at 06:25
  • I don't know I missed that simple line .... tq @gopal. Assigning navigationController a NewVC to ,in story board I done but when I pushing time I did't added navigation Controller. –  Mar 04 '17 at 06:33