im trying to set the initial view controller if a user has a token in his keychain.
when I try to set it in the appDelegate like this
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let accessToken: String? = KeychainWrapper.standard.string(forKey: "accessToken")
if accessToken != nil
{
// Take user to a home page
let mainStoryboard:UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let homePage = mainStoryboard.instantiateViewController(withIdentifier: "home") as! ViewLoader
self.window.rootViewController = homePage
}
return true
}
but I get som errors saying "Value of type 'AppDelegate' has no member 'window'"
it tried to clean the project but without luck