title: App crashes when opening after building it with Xcode 11.3.1
body: <p>After upgrading to Xcode 11.3.1 we noticed that our app started to crash on some devices when opening. It happens on different iOS versions and iPhone models. However on some devices with the same iOS version or iPhone model the app works fine.</p>
  
  <p>When installing an earlier build of the app on these devices (that was build with an earlier Xcode version) the crash does not occur.</p>
  
  <p>While debugging we found out that the crash occurs when trying to unwrap an <code>Optional</code> when using the presenter of our login module. This presenter has a value when created and is assigned but after setting our <code>rootViewController</code> in the AppDelegate <code>window.rootViewController = navigationController</code> the execution jumps to the <code>viewDidLoad()</code> function shown below at which point the presenter is <code>nil</code>.</p>
  
  <pre><code>class LoginViewController: LoginPasswordResetViewController {
      var presenter: LoginPresenterProtocol!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          updateUI(model: presenter.loadViewModel())
          presenter.viewDidLoad()
      }
  }
  </code></pre>
  
  <p>Relevant code in AppDelegate.swift:</p>
  
  <pre><code>class AppDelegate: UIResponder, UIApplicationDelegate {
  var window: UIWindow?
  
  func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
  
      let env = Environment()
  
      if let app = UIApplication.shared.delegate as? AppDelegate,
          let window = app.window,
          let loginVC = LoginModule().createModule(moduleData: LoginModuleData(env: env),
                                                   service: LoginService(env: env),
                                                   storageService: LocalStorageService(env: env)) {
  
          let navigationController = UINavigationController(rootViewController: loginVC)
  
          window.rootViewController = navigationController
          window.makeKeyAndVisible()
      }
      return true
  }
  </code></pre>
  
  <p>I tried using the SceneDelegate.swift mentioned here <a href="https://stackoverflow.com/questions/58082743/set-rootviewcontroller-ios-13">Set RootViewController iOS 13</a> to set the RootViewController with no luck.</p>
  
  <p>Any ideas on what could be the cause of this issue?</p>
  
  <p><strong>Additional info:</strong></p>
  
  <p>The <code>createModule</code> function initializes and sets the <code>presenter</code>:</p>
  
  <pre><code>func createModule(moduleData: LoginModuleDataProtocol, service: LoginServiceProtocol, storageService: LocalStorageServiceProtocol) -&gt; LoginViewController? {
      guard let viewController: LoginViewController = UIStoryboard.viewController(from: self) else {
          return nil
      }
      let presenter = LoginPresenter()
      let interactor = LoginInteractor()
      let router = LoginRouter()
  
      // VC
      viewController.presenter = presenter
      // Presenter
      presenter.viewController = viewController
      presenter.interactor = interactor
      presenter.router = router
      // Interactor
      interactor.presenter = presenter
      interactor.dataManager = LoginDataManager(data: moduleData, service: service, storageService: storageService)
      // Router
      router.viewController = viewController
  
      return viewController
  }
  </code></pre>
  
  <p>After creating the module, the <code>loginVC</code> variable has the <code>presenter</code> value as it should but as soon as we assign <code>window.rootViewController = navigationController</code> the value of <code>presenter</code> is <code>nil</code>.</p>