title: Completely black screen on setting initial view controller in AppDelegate
body: <p>All I want to do is go to the login screen if the user = nil. Otherwise it goes to the main/home section of the app which consists of the Tab Bar Controller's first view controller</p>
  
  <p>Here is my app delegate:</p>
  
  <pre><code>import UIKit
  import Firebase
  
  @UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate {
  
  var window: UIWindow?
  
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
      // Override point for customization after application launch.
      FirebaseApp.configure()
      let storyboard = UIStoryboard(name: "Main", bundle: nil)
  
      if Auth.auth().currentUser == nil &amp;&amp; !UserDefaults.standard.bool(forKey: "hasViewedWalkthrough") {
  
          let initialViewController = storyboard.instantiateViewController(withIdentifier: "WalkthroughViewController") as? WalkthroughViewController
          self.window?.rootViewController = initialViewController
  
  
      } else if Auth.auth().currentUser == nil &amp;&amp; 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
  }
  </code></pre>
  
  <p>I am not able to get to the onboarding or login screen. I am always led to the main screen. I know the screens are rendering fine if I manually set them as initial view controllers in storyboard.</p>
  
  <p>I have tried numerous solutions and none of them are working.</p>
  
  <p><strong>Update</strong>
  <a href="https://i.stack.imgur.com/58sXg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/58sXg.jpg" alt="enter image description here"></a></p>