title: Loading a screen from AppDelegate
body: <p>I'm trying to load a screen from the AppDelegate after a Deeplink into my app is tapped. Unfortunately it's crashing my app. </p>
  
  <p>I use this code to try present the UI: </p>
  
  <pre><code>self.window = UIWindow(frame: UIScreen.main.bounds)
  let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
  let bestViewController: BestViewController = mainStoryboard.instantiateViewController(withIdentifier: "BestViewController") as! BestViewController
  bestViewController.selectedBrocode = result
  let navigationViewController = BroNavigationViewController(rootViewController: bestViewController)
  self.window?.rootViewController = navigationViewController
  </code></pre>
  
  <p>This is printed in my console: </p>
  
  <pre><code>2017-08-08 16:00:48.685 BroCode[17567] &lt;Warning&gt; [Firebase/Analytics][I-ACS031011] Root view controller not found
  fatal error: unexpectedly found nil while unwrapping an Optional value
  2017-08-08 16:00:48.687130+0800 BroCode[17567:6659940] fatal error: unexpectedly found nil while unwrapping an Optional value
  </code></pre>
  
  <p>This is the stack trace:</p>
  
  <pre><code>libswiftCore.dylib`function signature specialization &lt;preserving fragile attribute, Arg[2] = Dead, Arg[3] = Dead&gt; of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, file : Swift.StaticString, line : Swift.UInt, flags : Swift.UInt32) -&gt; Swift.Never:
      0x1012ec3d0 &lt;+0&gt;:   stp    x26, x25, [sp, #-0x50]!
      0x1012ec3d4 &lt;+4&gt;:   stp    x24, x23, [sp, #0x10]
      0x1012ec3d8 &lt;+8&gt;:   stp    x22, x21, [sp, #0x20]
      0x1012ec3dc &lt;+12&gt;:  stp    x20, x19, [sp, #0x30]
      0x1012ec3e0 &lt;+16&gt;:  stp    x29, x30, [sp, #0x40]
      0x1012ec3e4 &lt;+20&gt;:  add    x29, sp, #0x40            ; =0x40 
      0x1012ec3e8 &lt;+24&gt;:  mov    x19, x6
      0x1012ec3ec &lt;+28&gt;:  mov    x20, x5
      0x1012ec3f0 &lt;+32&gt;:  mov    x21, x4
      0x1012ec3f4 &lt;+36&gt;:  mov    x22, x3
      0x1012ec3f8 &lt;+40&gt;:  mov    x23, x2
      0x1012ec3fc &lt;+44&gt;:  mov    x24, x1
      0x1012ec400 &lt;+48&gt;:  mov    x25, x0
      0x1012ec404 &lt;+52&gt;:  adr    x8, #0xf11fc              ; protocol descriptor for Swift._DefaultCustomPlaygroundQuickLookable + 136
      0x1012ec408 &lt;+56&gt;:  nop    
      0x1012ec40c &lt;+60&gt;:  add    x0, x8, #0x10             ; =0x10 
      0x1012ec410 &lt;+64&gt;:  mov    w1, #0x28
      0x1012ec414 &lt;+68&gt;:  orr    w2, wzr, #0x7
      0x1012ec418 &lt;+72&gt;:  bl     0x1012ec750               ; swift_rt_swift_allocObject
      0x1012ec41c &lt;+76&gt;:  mov    x8, x0
      0x1012ec420 &lt;+80&gt;:  stp    x22, x21, [x8, #0x10]
      0x1012ec424 &lt;+84&gt;:  strb   w20, [x8, #0x20]
      0x1012ec428 &lt;+88&gt;:  str    w19, [x8, #0x24]
      0x1012ec42c &lt;+92&gt;:  adr    x3, #0x40440              ; partial apply forwarder for Swift.(_fatalErrorMessage (Swift.StaticString, Swift.StaticString, file : Swift.StaticString, line : Swift.UInt, flags : Swift.UInt32) -&gt; Swift.Never).(closure #2)
      0x1012ec430 &lt;+96&gt;:  nop    
      0x1012ec434 &lt;+100&gt;: mov    x0, x25
      0x1012ec438 &lt;+104&gt;: mov    x1, x24
      0x1012ec43c &lt;+108&gt;: mov    x2, x23
      0x1012ec440 &lt;+112&gt;: mov    x4, x8
      0x1012ec444 &lt;+116&gt;: bl     0x1011cd4dc               ; function signature specialization &lt;preserving fragile attribute, Arg[1] = [Closure Propagated : reabstraction thunk helper from @callee_owned (@unowned Swift.UnsafeBufferPointer&lt;Swift.UInt8&gt;) -&gt; () to @callee_owned (@unowned Swift.UnsafeBufferPointer&lt;Swift.UInt8&gt;) -&gt; (@out ()), Argument Types : [@callee_owned (@unowned Swift.UnsafeBufferPointer&lt;Swift.UInt8&gt;) -&gt; ()]&gt; of generic specialization &lt;preserving fragile attribute, ()&gt; of Swift.StaticString.withUTF8Buffer &lt;A&gt; ((Swift.UnsafeBufferPointer&lt;Swift.UInt8&gt;) -&gt; A) -&gt; A
  -&gt;  0x1012ec448 &lt;+120&gt;: brk    #0x1
  </code></pre>
  
  <p>Screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/GUagw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GUagw.png" alt="enter image description here"></a></p>