swrevealviewcontrollerquickaction3dtouch

SWRevealViewController and 3D Touch quickActions


I have an application implementing a side menu in swift. (http://www.appcoda.com/sidebar-menu-swift/)

I implemented 3D touch shortcut, quick actions, it almost works.

The problem is I arrive directly on my view without instantiate revealViewController(), with the following code:

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let navVC = storyboard.instantiateViewControllerWithIdentifier("newsViewController") as! UINavigationController
self.window?.rootViewController?.presentViewController(navVC, animated: true, completion: nil)

I don't know how/where is instantiated revealViewController().

I have:

self.revealViewController() == nil 

What happens now is the menu doesn't want to open.

Thank you for your help :-)


Solution

  • For those who want to do it with Swift:

    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let frontNavigationController = storyboard.instantiateViewControllerWithIdentifier("planningViewController")
    let rearNavifationController = storyboard.instantiateViewControllerWithIdentifier("menuViewController")
    let mainRevealController : SWRevealViewController = SWRevealViewController(rearViewController: rearNavifationController, frontViewController: frontNavigationController)
    self.window?.rootViewController? = mainRevealController