Open robert1993 opened 4 years ago
If you set a breakpoint in the UITabBarController's viewWillAppear() method, will it trigger?
Also, does the UITabBarController has an identifier "UITabBarController" set?
Sorry for my late respons, I was to busy with other things last weeks.
No the method does not trigger although when I print the accestoken it does show up properly.
I've changed the code to
let homePage = mainStoryboard.instantiateViewController(identifier: "LiveViewController") as! LiveViewController
Since I Gues I can't use a tabbarcontroller to point to, but I need to use the first tab. I'm 100% sure the identifier was set correctly
Solved it by adding this code to the signIn page.
` override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated)
// Do any additional setup after loading the view.
let accessToken: String? = KeychainWrapper.standard.string(forKey: "accessToken")
print(accessToken!)
if accessToken != nil {
self.performSegue(withIdentifier: "ToSignIn", sender: "Any.")
}
}`
Hi Sergey,
When I try to let the application check if the accestoken is not nil and then go to the 'protected' view controller nothing is happening.
This is my Appdelegate:
` // // AppDelegate.swift // Tempi // // Created by Robert Sprenkels on 29/03/2020. // Copyright © 2020 Robert Sprenkels. All rights reserved. //
import UIKit import SwiftKeychainWrapper
@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
}
`
I Gues something has changed over the years, the way that swift handles this action but I can't find what it is. Can you help me out?
The accessToken is working just fine and is not nil.