One Logo Pool Ball
_SpriteKit_SwiftUI · IOS API REFERENCE

SpriteView

struct · iOS 14.0+ · SDK 27.1

@MainActor @preconcurrency struct SpriteView

The view to present your SKScene nodes in.

Members (3)

init · iOS 15.0+

init

TypeScript
static initSceneTransitionIsPausedPreferredFramesPerSecondOptionsDebugOptions(scene: _SpriteKit_SKScene, transition: (_SpriteKit_SKTransition) | null, isPaused: boolean, preferredFramesPerSecond: number, options: SpriteView_Options, debugOptions: SpriteView_DebugOptions): Promise<SpriteView>
Swift declaration
@preconcurrency nonisolated init(scene: SKScene, transition: SKTransition? = nil, isPaused: Bool = false, preferredFramesPerSecond: Int = 60, options: SpriteView.Options = [.shouldCullNonVisibleNodes], debugOptions: SpriteView.DebugOptions, shouldRender: @escaping @MainActor (TimeInterval) -> Bool = { _ in true })

Creates an instance with the given `scene`, `transition`, `isPaused` state and `shouldRender` delegate. - Parameters: - scene: SKScene to present - transition: the transition to use when presenting the scene. - isPaused: pauses the entire view if set to true - preferredFramesPerSecond: sets fps to define the desired rate for current SpriteView. Actual rate maybe limited by hardware or other software - options: set optimization options for the current view - debugOptions: set debug options for the current view - shouldRender: callback that allows to dynamically control the render rate. Return true to initiate and update for the target time Return false to skip update and render for the target time

init · iOS 14.0+

init

TypeScript
static initSceneTransitionIsPausedPreferredFramesPerSecondOptions(scene: _SpriteKit_SKScene, transition?: (_SpriteKit_SKTransition) | null, isPaused?: boolean, preferredFramesPerSecond?: number, options?: SpriteView_Options): Promise<SpriteView>
Swift declaration
@preconcurrency nonisolated init(scene: SKScene, transition: SKTransition? = nil, isPaused: Bool = false, preferredFramesPerSecond: Int = 60, options: SpriteView.Options = [.shouldCullNonVisibleNodes], shouldRender: @escaping @MainActor (TimeInterval) -> Bool = { _ in true })

Creates an instance with the given `scene`, `transition`, `isPaused` state and `shouldRender` delegate. - Parameters: - scene: SKScene to present - transition: the transition to use when presenting the scene. - isPaused: pauses the entire view if set to true - preferredFramesPerSecond: sets fps to define the desired rate for current SpriteView. Actual rate maybe limited by hardware or other software - options: set optimization options for the current view - shouldRender: callback that allows to dynamically control the render rate. Return true to initiate and update for the target time Return false to skip update and render for the target time

init · iOS 14.0+

init

TypeScript
static initSceneTransitionIsPausedPreferredFramesPerSecond(scene: _SpriteKit_SKScene, transition?: (_SpriteKit_SKTransition) | null, isPaused?: boolean, preferredFramesPerSecond?: number): Promise<SpriteView>
Swift declaration
nonisolated init(scene: SKScene, transition: SKTransition? = nil, isPaused: Bool = false, preferredFramesPerSecond: Int = 60)

Creates an instance with the given `scene`, `transition` and `isPaused` state. - Parameters: - scene: SKScene to present - transition: the transition to use when presenting the scene. - isPaused: pauses the entire view if set to true - preferredFramesPerSecond: sets fps to define the desired rate for current SpriteView. Actual rate maybe limited by hardware or other software

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

SpriteView.body

This protocol needs associated types that cannot yet cross the bridge.

All _SpriteKit_SwiftUI types →