title: AppDelegate and SceneDelegate when supporting iOS 12 and 13
body: <p>I need to support iOS 12 and iOS 13.</p>
  
  <p>Should I be duplicating code between <code>AppDelegate</code> and <code>SceneDelegate</code>?</p>
  
  <p>For example:</p>
  
  <pre><code>func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
      guard let windowScene = (scene as? UIWindowScene) else { return }
      let window = UIWindow(windowScene: windowScene)
  
      window.rootViewController = HomeViewController()
      window.makeKeyAndVisible()
  
      self.window = window
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
      let window = UIWindow(frame: UIScreen.main.bounds)
      window.rootViewController = HomeViewController()
      window.makeKeyAndVisible()
  
      self.window = window
  
      return true
  }
  </code></pre>
  
  <p>If I don't do this, in 1 version I end up with a black screen, but if I do and print in the <code>viewDidLoad</code> method of <code>HomeViewController</code> I can see it is called twice.</p>
  
  <p>I update my <code>didFinishLaunchingWithOptions</code> and I can see in <code>iOS13</code> it is still called twice.</p>
  
  <pre><code>func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
  
      guard #available(iOS 12, *) else { return true }
  
      let window = UIWindow(frame: UIScreen.main.bounds)
      window.rootViewController = HomeViewController()
      window.makeKeyAndVisible()
  
      self.window = window
  
      return true
  }
  </code></pre>