I have two ViewControllers. One is called LoginVC which also is my rootviewcontroller, the other one is named SignUpVC.
In my AppDelegate I have set my UINavigationbar like this:
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow()
window?.rootViewController = UINavigationController(rootViewController: LoginVC())
return true
}
then in my LoginVC I use this to get my SignUpVC to show but it doesn't work.
@objc func handleShowSignUp() {
let signUpVC = SignUpVC()
navigationController?.pushViewController(signUpVC, animated: true)
}
Can someone please explain to me what I'm doing wrong?
window.makeKeyAndVisible(). Besides that it looks about right.LoginVChasnavigationController