<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKScene",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKScene"
  },
  "title" : "SKScene"
}
-->

# SKScene

An object that organizes all of the active SpriteKit content.

```
class SKScene
```

## Overview

An [`SKScene`](/documentation/SpriteKit/SKScene) object represents a scene of content in SpriteKit. A scene is the root node in a tree of SpriteKit nodes ([`SKNode`](/documentation/SpriteKit/SKNode)). These nodes provide content that the scene animates and renders for display. To display a scene, you present it from an [`SKView`](/documentation/SpriteKit/SKView), [`SKRenderer`](/documentation/SpriteKit/SKRenderer), or <doc://com.apple.documentation/documentation/WatchKit/WKInterfaceSKScene>.

`SKScene` is a subclass of [`SKEffectNode`](/documentation/SpriteKit/SKEffectNode) and enables certain effects to apply to the entire scene. Though applying effects to an entire scene can be an expensive operation, creativity, and ingenuity may help you find some interesting ways to use effects.

## Topics

### Creating a Scene from a File

[Creating a Scene from a File](/documentation/SpriteKit/creating-a-scene-from-a-file)

Load a scene that you configure in Xcode’s scene editor.

### Creating a Scene Programmatically

Use code to manually create a scene and configure its properties.

[`+  sceneWithSize:`](/documentation/SpriteKit/SKScene/sceneWithSize:)

Creates and returns a new scene object.

[`-  initWithSize:`](/documentation/SpriteKit/SKScene/init(size:))

Initializes a new scene object.

[`size`](/documentation/SpriteKit/SKScene/size)

The dimensions of the scene, in points.

### Stretching Content to Fit the View

[Scaling a Scene’s Content to Fit the View](/documentation/SpriteKit/scaling-a-scene-s-content-to-fit-the-view)

Configure the scale mode to determine how a scene is sized to fit its view.

[`scaleMode`](/documentation/SpriteKit/SKScene/scaleMode)

A setting that defines how the scene is mapped to the view that presents it.

[`SKSceneScaleMode`](/documentation/SpriteKit/SKSceneScaleMode)

The modes that determine how the scene’s area is mapped to the view that presents it.

### Configuring the Viewport

Define which portion of the scene is visible at a given time.

[Positioning a Scene’s Origin Within its View](/documentation/SpriteKit/positioning-a-scene-s-origin-within-its-view)

Try the different ways to configure the scene’s origin inside its view.

[`camera`](/documentation/SpriteKit/SKScene/camera)

The camera node in the scene that determines what part of the scene’s coordinate space is visible in the view.

[`anchorPoint`](/documentation/SpriteKit/SKScene/anchorPoint)

The point in the view’s frame that corresponds to the scene’s origin.

### Responding to Loading and Resizing Events

Override these functions to be notified when a scene is loaded or presented, or changes size.

[`-  sceneDidLoad`](/documentation/SpriteKit/SKScene/sceneDidLoad())

Tells you when the scene is presented.

[`-  didChangeSize:`](/documentation/SpriteKit/SKScene/didChangeSize(_:))

Tells you when the scene’s size has changed.

[`-  willMoveFromView:`](/documentation/SpriteKit/SKScene/willMove(from:))

Tells you when the scene is about to be removed from a view.

[`-  didMoveToView:`](/documentation/SpriteKit/SKScene/didMove(to:))

Tells you when the scene is presented by a view.

### Responding to Frame-Cycle Events

Callbacks occur every frame, telling you when to perform app logic.

[Responding to Frame-Cycle Events](/documentation/SpriteKit/responding-to-frame-cycle-events)

Implement per-frame app logic, such as the scene’s update function that’s called every frame.

[`-  update:`](/documentation/SpriteKit/SKScene/update(_:))

Tells your app to perform any app-specific logic to update your scene.

[`-  didEvaluateActions`](/documentation/SpriteKit/SKScene/didEvaluateActions())

Tells your app to peform any necessary logic after scene actions are evaluated.

[`-  didSimulatePhysics`](/documentation/SpriteKit/SKScene/didSimulatePhysics())

Tells your app to peform any necessary logic after physics simulations are performed.

[`-  didApplyConstraints`](/documentation/SpriteKit/SKScene/didApplyConstraints())

Tells your app to peform any necessary logic after constraints are applied.

[`-  didFinishUpdate`](/documentation/SpriteKit/SKScene/didFinishUpdate())

Tells your app to peform any necessary logic after the scene has finished all of the steps required to process animations.

### Configuring a Delegate

Instead of subclassing a scene to respond to update life-cycle events, assign a delegate to field them.

[Subclassing Scenes Versus Assigning a Delegate](/documentation/SpriteKit/subclassing-scenes-versus-assigning-a-delegate)

Use a scene delegate to share app logic across various scenes.

[`delegate`](/documentation/SpriteKit/SKScene/delegate)

A delegate to be called during the animation loop.

[`SKSceneDelegate`](/documentation/SpriteKit/SKSceneDelegate)

Methods that, when implemented, allow any class to participate in the SpriteKit render loop callbacks.

### Setting the Background Appearance

Adjust content that’s under a scene.

[Creating a Scene with a Transparent Background](/documentation/SpriteKit/creating-a-scene-with-a-transparent-background)

Set a transparent background color to show the content of the views below.

[`view`](/documentation/SpriteKit/SKScene/view)

The view that is currently presenting the scene.

[`backgroundColor`](/documentation/SpriteKit/SKScene/backgroundColor)

The background color of the scene.

### Configuring Physics Properties

[`physicsWorld`](/documentation/SpriteKit/SKScene/physicsWorld)

The physics simulation associated with the scene.

### Adding Positional Audio

Enable positional audio by defining a listener.

[Using Audio Nodes with the Scene’s Listener](/documentation/SpriteKit/using-audio-nodes-with-the-scene-s-listener)

Add audio to your scene, and optionally give it 2D-positional mixing characteristics.

[`listener`](/documentation/SpriteKit/SKScene/listener)

A node used to determine the position of the listener for positional audio in the scene.

[`audioEngine`](/documentation/SpriteKit/SKScene/audioEngine)

The AVFoundation audio engine used to play audio from audio nodes contained in the scene.

### Converting Between Coordinate Systems

[`-  convertPointFromView:`](/documentation/SpriteKit/SKScene/convertPoint(fromView:))

Converts a point from view coordinates to scene coordinates.

[`-  convertPointToView:`](/documentation/SpriteKit/SKScene/convertPoint(toView:))

Converts a point from scene coordinates to view coordinates.

## Relationships

### Conforms To

[`UIActivityItemsConfigurationProviding`](/documentation/UIKit/UIActivityItemsConfigurationProviding)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`UICoordinateSpace`](/documentation/UIKit/UICoordinateSpace)

[`NSStandardKeyBindingResponding`](/documentation/AppKit/NSStandardKeyBindingResponding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`SKWarpable`](/documentation/SpriteKit/SKWarpable)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`UIFocusItem`](/documentation/UIKit/UIFocusItem)

[`GKSceneRootNodeType`](/documentation/GameplayKit/GKSceneRootNodeType)

[`UIFocusEnvironment`](/documentation/UIKit/UIFocusEnvironment)

[`Copyable`](/documentation/Swift/Copyable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSUserActivityRestoring`](/documentation/AppKit/NSUserActivityRestoring)

[`Sendable`](/documentation/Swift/Sendable)

[`Escapable`](/documentation/Swift/Escapable)

[`UIResponderStandardEditActions`](/documentation/UIKit/UIResponderStandardEditActions)

[`UIFocusItemContainer`](/documentation/UIKit/UIFocusItemContainer)

[`Hashable`](/documentation/Swift/Hashable)

[`UIPasteConfigurationSupporting`](/documentation/UIKit/UIPasteConfigurationSupporting)

[`UIUserActivityRestoring`](/documentation/UIKit/UIUserActivityRestoring)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

### Inherits From

[`SKEffectNode`](/documentation/SpriteKit/SKEffectNode)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)