<!--
{
  "documentType" : "article",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/subclassing-scenes-versus-assigning-a-delegate",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Subclassing Scenes Versus Assigning a Delegate"
}
-->

# Subclassing Scenes Versus Assigning a Delegate

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

## Discussion

Often, your app subclasses [`SKScene`](/documentation/SpriteKit/SKScene) to deliver gameplay. Your subclass usually:

- Lays out initial scene content
- Defines app logic that runs every frame
- Implements responder methods to handle keyboard, mouse, or touch events

An alternative pattern is to assign a [`delegate`](/documentation/SpriteKit/SKView/delegate) that handles [`SKScene`](/documentation/SpriteKit/SKScene) instead. For example, if you make the view controller the delegate for your scene, it can use multiple scenes that share the same [`SKSceneDelegate`](/documentation/SpriteKit/SKSceneDelegate) implementations. The view controller participates in event handling and so it can respond to user input also.

> Important:
> On macOS, you need to set the window’s <doc://com.apple.documentation/documentation/AppKit/NSResponder/nextResponder> to your app’s view controller because by default, the view is the first responder to user input events.

---

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)