I have the following code in GameViewController.swift:
override func viewDidLoad() {
super.viewDidLoad()
let scene: GameScene = GameScene()
let currentView = self.view as! SKView
currentView.showsFPS = true
currentView.showsNodeCount = true
currentView.presentScene(scene)
}
It crashes at let currentView = self.view as! SKView.
with this message:
Could not cast value of type 'UIView' (0x1079b7e88) to 'SKView' (0x106b79718)
There was a similar question posed, but their solution was in the storyboard. I have no storyboards, just code.