<!--
{
  "documentType" : "article",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/use-spritekit-objects-within-scene-delegate-callbacks",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Use SpriteKit Objects within Scene Delegate Callbacks"
}
-->

# Use SpriteKit Objects within Scene Delegate Callbacks

Follow threading guidelines to keep your SpriteKit app thread safe.

## Discussion

SpriteKit is largely a single threaded game engine and as such the API provides developers with callbacks to implement your custom game logic. The primary callback for your game logic is [`update(_:for:)`](/documentation/SpriteKit/SKSceneDelegate/update(_:for:)). Other callbacks are illustrated in [`SKSceneDelegate`](/documentation/SpriteKit/SKSceneDelegate). Modifying SpriteKit objects outside of the scene delegate callbacks (such as in a background queue or anything else not running on the main thread) can result in concurrency related problems. Even dispatching work on the main thread asynchronously or at a later time is risky because the closure is likely to be done outside of the timeframe SpriteKit expects. If you’re experiencing a segmentation fault or other type of crash occurring deep within the SpriteKit framework, there’s a good chance your code is modifying a SpriteKit object outside of the scene delegate callbacks.

> Note:
> To check at runtime if a particular block of code is running on the main thread, inspect <doc://com.apple.documentation/documentation/Foundation/Thread/isMainThread-swift.property>.

---

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)