Все, что я хочу сделать, это go на экран входа в систему, если пользователь = ноль. В противном случае он переходит в основной / домашний раздел приложения, который состоит из первого контроллера представления панели вкладок
Вот мой делегат приложения:
import UIKit
import Firebase
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FirebaseApp.configure()
let storyboard = UIStoryboard(name: "Main", bundle: nil)
if Auth.auth().currentUser == nil && !UserDefaults.standard.bool(forKey: "hasViewedWalkthrough") {
let initialViewController = storyboard.instantiateViewController(withIdentifier: "WalkthroughViewController") as? WalkthroughViewController
self.window?.rootViewController = initialViewController
} else if Auth.auth().currentUser == nil && UserDefaults.standard.bool(forKey: "hasViewedWalkthrough") {
let initialViewController = storyboard.instantiateViewController(withIdentifier: "loginViewController") as? LoginViewController
self.window?.rootViewController = initialViewController
} else {
let initialViewController = storyboard.instantiateViewController(withIdentifier: "homeTabBarController") as? MainTabBarViewController
self.window?.rootViewController = initialViewController
}
self.window?.makeKeyAndVisible()
return true
}
Я не могу добраться до экран регистрации или входа. Меня всегда ведут на главный экран. Я знаю, что экраны воспроизводятся нормально, если я вручную установил их в качестве начальных контроллеров представления в раскадровке.
Я пробовал множество решений, и ни одно из них не работает.
Обновление ![enter image description here](https://i.stack.imgur.com/58sXg.jpg)