SWRevealViewController icon indicating copy to clipboard operation
SWRevealViewController copied to clipboard

Parent ViewController == nil

Open ghost opened this issue 7 years ago • 8 comments

i have leftside menu in my project . i had given "sw-rear "to my leftmenuVC . After clicking my menubutton i am getting ParentVC as nil.

    navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage(named:"ic_menu"), style: UIBarButtonItemStyle.plain, target: self, action: #selector(menuButtonPressed))



@objc func menuButtonPressed()
    {
        if revealViewController() != nil{
            self.navigationItem.leftBarButtonItem?.target = self.revealViewController()
            self.navigationItem.leftBarButtonItem?.action = #selector(SWRevealViewController.revealToggle(_:))
            self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
        }

}

ghost avatar Nov 13 '17 09:11 ghost

It is not sw-rear but sw_rear

iDevelopper avatar Nov 13 '17 09:11 iDevelopper

by mistake i type here like that but in project i mentioned correct.

ghost avatar Nov 13 '17 09:11 ghost

screen shot 2017-11-13 at 3 22 01 pm

ghost avatar Nov 13 '17 09:11 ghost

What is ParentVC?

iDevelopper avatar Nov 13 '17 09:11 iDevelopper

the parent should Come as SWRevealViewController

ghost avatar Nov 13 '17 09:11 ghost

screen shot 2017-11-13 at 3 26 53 pm

ghost avatar Nov 13 '17 09:11 ghost

Main.storyboard.zip

This is my storyBoard. Can check and let me know the mistake that i did

ghost avatar Nov 13 '17 09:11 ghost

I can't see a sw_front segue in your storyboard, how do you set the front view controller? SWRevealViewController should be the initial controller and ActivitiesVC the front view controller...

iDevelopper avatar Nov 13 '17 10:11 iDevelopper