book--hacking-with-swift/36-crashy-plane/Crashy Plane/Source/Controllers/Home/GameViewController.swift

53 lines
1.3 KiB
Swift

//
// GameViewController.swift
// Crashy Plane
//
// Created by Brian Sipple on 3/2/19.
// Copyright © 2019 Brian Sipple. All rights reserved.
//
import UIKit
import SpriteKit
import GameplayKit
class GameViewController: UIViewController {
let isDebugging = false
override func viewDidLoad() {
super.viewDidLoad()
if let view = self.view as! SKView? {
// Load the SKScene from 'GameScene.sks'
if let scene = SKScene(fileNamed: "GameScene") {
// Set the scale mode to scale to fit the window
scene.scaleMode = .resizeFill
// Present the scene
view.presentScene(scene)
}
view.ignoresSiblingOrder = true
view.showsFPS = isDebugging
view.showsNodeCount = isDebugging
view.showsPhysics = isDebugging
}
}
override var shouldAutorotate: Bool {
return true
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
if UIDevice.current.userInterfaceIdiom == .phone {
return .allButUpsideDown
} else {
return .all
}
}
override var prefersStatusBarHidden: Bool {
return true
}
}