---
title: "setControlsDelegate(_:queue:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcapturesession/setcontrolsdelegate(_:queue:)"
---

# setControlsDelegate(_:queue:)

Sets a delegate object for the system to call when it activates and presents controls.

## Declaration

```swift
func setControlsDelegate(_ controlsDelegate: (any AVCaptureSessionControlsDelegate)?, queue controlsDelegateCallbackQueue: dispatch_queue_t?)
```

## Parameters

- `controlsDelegate`: An object that adopts the controls delegate protocol.
- `controlsDelegateCallbackQueue`: A serial dispatch queue on which to call the delegate methods. You must specify a serial queue to ensure callbacks occur in order. This argument must not be nil unless the controlsDelegate argument is also nil; otherwise, the system throws an doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException.

## Mentioned in

Enhancing your app experience with the Camera Control

## Discussion

Discussion People interact with capture controls by performing specific gestures to enable their visibility. Specify a delegate to for the system to call when it presents and dismisses controls. The system calls the delegate’s methods on the specified callback queue.

## See Also

### Configuring capture controls

- [supportsControls](avfoundation/avcapturesession/supportscontrols.md)
- [maxControlsCount](avfoundation/avcapturesession/maxcontrolscount.md)
- [controls](avfoundation/avcapturesession/controls.md)
- [canAddControl(_:)](avfoundation/avcapturesession/canaddcontrol(_:).md)
- [addControl(_:)](avfoundation/avcapturesession/addcontrol(_:).md)
- [removeControl(_:)](avfoundation/avcapturesession/removecontrol(_:).md)
- [AVCaptureSessionControlsDelegate](avfoundation/avcapturesessioncontrolsdelegate.md)
- [controlsDelegate](avfoundation/avcapturesession/controlsdelegate.md)
- [controlsDelegateCallbackQueue](avfoundation/avcapturesession/controlsdelegatecallbackqueue.md)
