class ViewController: UIViewController, UINavigationControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
navigationController!
The UINavigationController
has displayed two instances of a UIViewController
From the UINavigationControllerDelegate documentation
Called just after the navigation controller displays a view controller’s view and navigation item properties.
Instead of logging "showViewController", log the UIViewController
instance to see what's going on
func navigationController(navigationController: UINavigationController, didShowViewController viewController: UIViewController, animated: Bool) {
print(viewController)
}