I want to change the root controller of my navigation controller programatically:
import UIKit
import Foundation
class NavigationController : UINavigationController {
override init(rootViewController : UIViewController) {
print("TEST")
super.init(rootViewController : rootViewController)
}
override init(navigationBarClass: AnyClass?, toolbarClass: AnyClass?) {
print("TEST2")
super.init(navigationBarClass : navigationBarClass, toolbarClass : toolbarClass)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
}
I set the NavigationController class as custom class of my Navigation Controller in the storyboard
The console does not show my test output. What am I doing wrong and how can I change the root controller here?