title: Could not cast value of type 'UIView' to 'SKView' (removed Storyboard)
body: <p>I'm working for the first time with SpriteKit and I have an issue at app launch:</p>
  <blockquote>
  <p>Could not cast value of type 'UIView' (0x2038a8848) to 'SKView' (0x2039f2658).</p>
  </blockquote>
  <p><a href="https://stackoverflow.com/questions/33003621/could-not-cast-value-of-type-uiview-to-skview">This question</a> makes clear that you have to set the <code>GameViewController</code>'s <code>view</code> custom class to <code>SKView</code> and explain how to do it using Storyboard. The problem is that I'm trying to do it programmatically, as i removed the Storyboard, and I have no idea how to do it. As I'm used to UIKit, this has never gave me issues of any kind.</p>
  <p>So, in <code>AppDelegate</code> i say:</p>
  <pre><code>func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
      
      let window = UIWindow(frame: UIScreen.main.bounds)
      window.rootViewController = GameViewController()
      window.makeKeyAndVisible()
      self.window = window
      return true
  }
  </code></pre>
  <p>In <code>GameViewController</code>:</p>
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
      
      let skView = view as! SKView
      skView.ignoresSiblingOrder = true
  
      gameScene = GameScene(size: view.frame.size)
      gameScene!.scaleMode = .aspectFill
      gameScene!.gameSceneDelegate = self
      
      show(gameScene!, animated: true)
      
  }
  </code></pre>
  <p>All I get is the up above error when i try do downcast the VC <code>view</code> as a <code>SKView</code>.
  Can anybody shine a light on how to launch the app programmatically under these conditions please?</p>