I have a viewcontroller, i named it as SelectionPopUpViewController
. I embed that controller on a UINavigationController
.
From SelectionPopUpViewController.swift
, I put:
@IBAction func okTapped(sender: AnyObject) {
self.dismissViewControllerAnimated(false, completion: nil)
let homeVc = UIStoryboard(name: "Home", bundle: nil).instantiateViewControllerWithIdentifier("Home") as HomeViewController
self.navController = UINavigationController(rootViewController: homeVc)
self.window?.rootViewController = self.navController
//self.navController.pushViewController(homeVc, animated: true)
}
on above I put :
weak var window : UIWindow?
var navController : UINavigationController!
What I want is when user click that okTapped
button, it will go to HomeViewController
. I try to initialize like that but it did not work. Maybe my initialization wrong.
What is the correct code to made that button work (go to HomeViewController
)?