-2

I simply implemented this tutorial until minute 8:35 , and it did not work.

 import Foundation
  class ViewController: UIViewController {
@IBOutlet weak var Open: UIBarButtonItem!
override func viewDidLoad() {
    super.viewDidLoad()
    print("open")
    Open.target = self.revealViewController()
    Open.action = Selector("revealToggle:")
     print("open2")
}
override func viewDidAppear(_ animated: Bool) {
}
override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}}

However, its worth to note. I am getting to this page after splash screen page.And below how am doing it

  let storyboard = UIStoryboard(name: "Main", bundle: nil)                                
    let vc = storyboard.instantiateViewController(withIdentifier: "Navigate") as! UINavigationController                            
                        //self.present(vc, animated: true, completion: nil)
                        let appDelegate = UIApplication.shared.delegate as! AppDelegate
                        appDelegate.window?.rootViewController = vc

From Splashscontroller i am calling to go main.storyboard. Navigate, I click on navigation controller and give it storyboardid Navigate.

I get to the page, with open button..but no right reveal controller opens when i click on it.

NSNoob
  • 5,548
  • 6
  • 41
  • 54
krikor Herlopian
  • 731
  • 1
  • 10
  • 23

1 Answers1

0

Please edit your appdelegate "didFinishLaunchingWithOptions" method's code as below

// create viewController code...

    let storyboard = UIStoryboard(name: "Main", bundle: nil) 

let mainViewController = storyboard.instantiateViewControllerWithIdentifier(""Navigate") as! UINavigationController

let leftViewController = storyboard.instantiateViewControllerWithIdentifier("Left") as! LeftSideMenuViewController 

let slideMenuController = SlideMenuController(SailDataViewController:mainViewController , LeftSideMenuViewController : leftViewController)

   self.window?.rootViewController = slideMenuController
   self.window?.makeKeyAndVisible()

 UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true) 

please check in your class name , because I haven't run this code . But in my project it is working.

Harish Singh
  • 765
  • 1
  • 12
  • 23