Create 2D sprite-based games using an optimized animation system, physics simulation, and event-handling support.
- iOS 7.0+
- macOS 10.9+
- tvOS 9.0+
- watchOS 3.0+
SpriteKit is a graphics rendering and animation infrastructure that you can use to animate arbitrary textured images, otherwise known as sprites. SpriteKit provides a traditional rendering loop that alternates between determining the contents of and rendering frames. You determine the contents of the frame and how those contents change. SpriteKit does the work to render that frame efficiently using graphics hardware. SpriteKit is optimized for applying arbitrary animations or changes to your content. This design makes SpriteKit more suitable for games and apps that require flexibility in how animations are handled.
Getting Started with SpriteKit
SpriteKit implements content as a hierarchical tree structure of nodes. A node tree consists of a scene node as the root node and other nodes that provide content. Each frame of a scene is processed and rendered to a view. The scene executes actions and simulates physics, both of which change the contents of the tree. Then the scene is rendered efficiently using SpriteKit.
To start learning SpriteKit, you should look at these classes in the following order, before moving on to other classes in the framework:
SpriteKit Programming Guide includes an exercise that teaches these classes.