Type Alias

SCNSceneSourceStatusHandler

The signature for the block that SceneKit calls periodically to report progress while loading a scene.

Declaration

typealias SCNSceneSourceStatusHandler = (Float, SCNSceneSourceStatus, Error?, UnsafeMutablePointer<ObjCBool>) -> Void

Discussion

You provide a block with this signature when using the scene(options:statusHandler:) method.

The block takes four parameters:

totalProgress

A floating-point number between 0.0 and 1.0 indicating the overall progress of loading the scene. A value of 0.0 indicates that the loading process has just begun, and a value of 1.0 indicates that the process has completed.

status

A constant identifying one of the distinct phases of SceneKit’s loading procedure. See SCNSceneSourceStatus for possible values.

error

An error object describing any error that has occurred during scene loading, or nil if no errors has been encountered.

stopLoading

A reference to a Boolean value. Set *stop to true within the block to abort further processing of the scene source’s contents.