<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureSession/setDeferredStartDelegate(_:deferredStartDelegateCallbackQueue:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureSession(im)setDeferredStartDelegate:deferredStartDelegateCallbackQueue:"
  },
  "title" : "setDeferredStartDelegate(_:deferredStartDelegateCallbackQueue:)"
}
-->

# setDeferredStartDelegate(_:deferredStartDelegateCallbackQueue:)

Sets a delegate object for the session to call when performing deferred start.

```
func setDeferredStartDelegate(_ deferredStartDelegate: (any AVCaptureSessionDeferredStartDelegate)?, deferredStartDelegateCallbackQueue: dispatch_queue_t?)
```

## Parameters

`deferredStartDelegate`

An object conforming to the [`AVCaptureSessionDeferredStartDelegate`](/documentation/AVFoundation/AVCaptureSessionDeferredStartDelegate) protocol that receives events about deferred start.

`deferredStartDelegateCallbackQueue`

A dispatch queue on which deferredStart delegate methods are called.

## Discussion

This delegate receives a call to the [`sessionWillRunDeferredStart(_:)`](/documentation/AVFoundation/AVCaptureSessionDeferredStartDelegate/sessionWillRunDeferredStart(_:)) method when deferred start is about to run. It is non-blocking, so by the time this method is called, the deferred start may already be underway. If you want your app to perform initialization (potentially) concurrently with deferred start (e.g. user-facing camera features that are not needed to display the first preview frame, but are available to the user as soon as possible) it may be done in the delegate’s [`sessionWillRunDeferredStart(_:)`](/documentation/AVFoundation/AVCaptureSessionDeferredStartDelegate/sessionWillRunDeferredStart(_:)) method. To wait until deferred start is finished to perform some remaining initialization work, use the [`sessionDidRunDeferredStart(_:)`](/documentation/AVFoundation/AVCaptureSessionDeferredStartDelegate/sessionDidRunDeferredStart(_:)) method instead.

The delegate receives a call to the [`sessionDidRunDeferredStart(_:)`](/documentation/AVFoundation/AVCaptureSessionDeferredStartDelegate/sessionDidRunDeferredStart(_:)) method when the deferred start finishes running. This allows you to run less-critical application initialization code. For example, if you’ve deferred an [`AVCapturePhotoOutput`](/documentation/AVFoundation/AVCapturePhotoOutput) by setting its [`isDeferredStartEnabled`](/documentation/AVFoundation/AVCaptureOutput/isDeferredStartEnabled) property to `true`, and you’d like to do some app-specific initialization related to still capture, here might be a good place to put it.

If the delegate is non-nil, the session still calls the [`sessionWillRunDeferredStart(_:)`](/documentation/AVFoundation/AVCaptureSessionDeferredStartDelegate/sessionWillRunDeferredStart(_:)) and [`sessionDidRunDeferredStart(_:)`](/documentation/AVFoundation/AVCaptureSessionDeferredStartDelegate/sessionDidRunDeferredStart(_:)) methods regardless of the value of the session’s [`automaticallyRunsDeferredStart`](/documentation/AVFoundation/AVCaptureSession/automaticallyRunsDeferredStart) property.

To minimize the capture session’s startup latency, defer all unnecessary work until after the session starts. This delegate provides callbacks for you to schedule deferred work without impacting session startup performance.

To perform initialization prior to deferred start but after the user interface displays, set [`automaticallyRunsDeferredStart`](/documentation/AVFoundation/AVCaptureSession/automaticallyRunsDeferredStart) to `false`, and then run the custom initialization prior to calling [`runDeferredStartWhenNeeded()`](/documentation/AVFoundation/AVCaptureSession/runDeferredStartWhenNeeded()).

If [`deferredStartDelegate`](/documentation/AVFoundation/AVCaptureSession/deferredStartDelegate) is not `NULL`, the session throws an exception if [`deferredStartDelegateCallbackQueue`](/documentation/AVFoundation/AVCaptureSession/deferredStartDelegateCallbackQueue) is `nil`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)