Contents

runDeferredStartWhenNeeded()

Tells the session to run deferred start when appropriate.

Declaration

func runDeferredStartWhenNeeded()

Discussion

For best perceived startup performance, call this after displaying the first frame, so that deferred start processing doesn’t interfere with other initialization operations. For example, if using a CAMetalLayer to draw camera frames, add a presentHandler (using doc://com.apple.documentation/metal/mtldrawable/addpresentedhandler) to the first drawable and call runDeferredStartWhenNeeded() from there.

If one or more outputs need to start to perform a capture operation, and runDeferredStartWhenNeeded() has not run yet, the session runs the deferred start on your app’s behalf. Only call this method once for each configuration commit - after the first call, subsequent calls to runDeferredStartWhenNeeded() have no effect. The deferred start runs asynchronously, so this method returns immediately.

See Also

Configuring deferred start