Create Scene (SKScene)

  • based on size:
let scene = GameScene(size: view.bounds.size)
  • based on scene file (“GameScene.sks” on this case):
guard let scene = SKScene(fileNamed: "GameScene") else {

Configure Scene

Some useful properties:

  • showsFPS – show frames/second;
  • showsNodeCount – show the number of nodes;
  • ignoresSiblingOrder – ignore sibling order when rendering.

Create/Get SpriteKit View (SKView)

  1. Change view controllers’s view to SKView type (instead of UIView) on storyboard (if using it).
  2. Get view as SKView:
let skView = view as! SKView

Configure SKView

Some useful properties:

  • scaleMode – change view’s scale mode.