Contents

isDeferredStartEnabled

A BOOL value that indicates whether to defer starting this preview layer.

Declaration

var isDeferredStartEnabled: Bool { get set }

Discussion

When this value is true, the session does not prepare the output’s resources until some time after startRunning() returns. You can start the visual parts of your user interface (e.g. preview) prior to other parts (e.g. photo/movie capture, metadata output, etc..) to improve startup performance. Set this value to false if your app needs video preview immediately for startup, and true if it does not.

By default, this value is false for AVCaptureVideoPreviewLayer objects, since this object is used to display preview. For best session start performance, set isDeferredStartEnabled to false for preview layers. If your app contains multiple preview layers, you may want to display the main preview layer as soon as possible and allow the remaining layers to display subsequently. In this case, set isDeferredStartEnabled to true for the remaining layers.

If isDeferredStartSupported is false, setting this property value to true results in the session throwing an NSInvalidArgumentException.

See Also

Configuring deferred start