I am using SWRevealViewController for a slide out menu in one of my project. I have a scenario in which I have a View Controller not connected to the reveal view controller/front VC/RearVC . I am moving to this VC from one of my VC via presentViewController().
My destination VC i.e "myVC" is embedded in a nav.controller and it has a menu button which I want should perform the sliding menu action, but I always get an error in the following line
self.test.target = self.revealViewController()
self.test.action = Selector("revealToggle:")
self.view!.addGestureRecognizer(self.revealViewController().panGestureRecognizer())//fatal error: unexpectedly found nil while unwrapping an Optional value
Neither the menu button nor the swipe is working for me.
UPDATE
I even have tried this stuff of code -
var navController = self.storyboard!.instantiateViewControllerWithIdentifier("myNVC") as! UINavigationController
var navController: UINavigationController =
self.revealViewController().frontViewController = navController//fatal error: unexpectedly found nil while unwrapping an Optional value
self.revealViewController().setFrontViewPosition(.Left, animated: true)
I have attached a version of my work in a demo screenshot below where you can see in the bottom of the story board there is a ViewController embedded in a nav. controller. So now how can I show the rear_VC while swiping.
Please help !!