---
title: focusMode
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avcapturedevice/focusmode-swift.property
---

# focusMode

The capture device’s focus mode.

## Declaration

```swift
var focusMode: AVCaptureDevice.FocusMode { get set }
```

## Discussion

Discussion Before changing the value of this property, you must call lockForConfiguration() to acquire exclusive access to the device’s configuration properties. Otherwise, setting the value of this property raises an exception. When you finish configuring the device, call unlockForConfiguration() to release the lock and allow other devices to configure the settings. This property is key-value observable.

## See Also

### Configuring automatic focus

- [isFocusModeSupported(_:)](avfoundation/avcapturedevice/isfocusmodesupported(_:).md)
- [AVCaptureDevice.FocusMode](avfoundation/avcapturedevice/focusmode-swift.enum.md)
- [isSmoothAutoFocusSupported](avfoundation/avcapturedevice/issmoothautofocussupported.md)
- [isSmoothAutoFocusEnabled](avfoundation/avcapturedevice/issmoothautofocusenabled.md)
- [isFaceDrivenAutoFocusEnabled](avfoundation/avcapturedevice/isfacedrivenautofocusenabled.md)
- [automaticallyAdjustsFaceDrivenAutoFocusEnabled](avfoundation/avcapturedevice/automaticallyadjustsfacedrivenautofocusenabled.md)
- [isAutoFocusRangeRestrictionSupported](avfoundation/avcapturedevice/isautofocusrangerestrictionsupported.md)
- [autoFocusRangeRestriction](avfoundation/avcapturedevice/autofocusrangerestriction-swift.property.md)
- [AVCaptureDevice.AutoFocusRangeRestriction](avfoundation/avcapturedevice/autofocusrangerestriction-swift.enum.md)
