Compare the different ways to display a SpriteKit scene.
To display SpriteKit content in a watch app, you use
WKInterface, whereas on iOS, macOS, and tvOS, you use
SKView to display a SpriteKit scene. If you need to mix SpriteKit with any custom Metal content, use
On iOS, tvOS, and macOS, Draw Using a View or a Renderer
Choose from the options below to display SpriteKit content on iOS, tvOS, or macOS.
Draw Using a View
Draw Using a Renderer
When you want to mix SpriteKit content with your own Metal content, use
SKRenderer to draw your
SKScene. You might use
SKRenderer to replace specific portions of a SpriteKit app with custom Metal code, or vice versa.
SKRenderer combines the full control of Metal with the ease of use of SpriteKit and its library of useful objects.
For example, to take full control of just your game's tiled background while using SpriteKit to draw the rest, use an
MTLView combination instead of
SKView, and then write the tiled background code yourself in Metal.
render(with. Finally, call
present(_:) on a Metal view when you're ready to present a frame.