Once a user logs into my application, the below function should automatically redirect the user to a View Controller named ‘TabViewController’.
transitionToHome() {
let tabViewController = storyboard?.instantiateViewController(withIdentifier: Constants.Storyboard.TabViewController) as? TabViewController
view.window?.rootViewController = tabViewController
view.window?.makeKeyAndVisible()
}
Currently, when this function is run, it just produces a fully black screen, instead of taking the user to the TabViewController.
Here is a screenshot from Xcode of my ViewController.
Once a user logs into my application, the below function should automatically redirect the user to a View Controller named ‘TabViewController’.
transitionToHome() {
let tabViewController = storyboard?.instantiateViewController(withIdentifier: Constants.Storyboard.TabViewController) as? TabViewController
view.window?.rootViewController = tabViewController
view.window?.makeKeyAndVisible()
}
Currently, when this function is run, it just produces a fully black screen, instead of taking the user to the TabViewController.
Here is a screenshot from Xcode of my ViewController.
This is the code in my ‘TabViewController.swift’ file
import UIKit
class TabViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
}
Any help would be greatly appreciated in explaining why this might be happening and how to actually get it to redirect to the TabViewController, thanks!