Last active
          August 29, 2015 14:10 
        
      - 
      
- 
        Save lbehnke/4f5b5e16f6fb201abeb6 to your computer and use it in GitHub Desktop. 
    Display SpriteKit view. In your storyboard, set the view's custom class to SKView.
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import SpriteKit | |
| class MySKScene: SKScene { | |
| // implementation | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import UIKit | |
| import SpriteKit | |
| class GameViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| let skView = self.view as SKView | |
| skView.showsFPS = true | |
| skView.showsNodeCount = true | |
| skView.ignoresSiblingOrder = true | |
| let scene = MySKScene(size: skView.bounds.size) | |
| scene.scaleMode = .AspectFill | |
| skView.presentScene(scene) | |
| } | |
| override func shouldAutorotate() -> Bool { | |
| return true | |
| } | |
| override func supportedInterfaceOrientations() -> Int { | |
| if UIDevice.currentDevice().userInterfaceIdiom == .Phone { | |
| return Int(UIInterfaceOrientationMask.AllButUpsideDown.rawValue) | |
| } else { | |
| return Int(UIInterfaceOrientationMask.All.rawValue) | |
| } | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment