---
title: userPreferredCamera
framework: avfoundation
role: symbol
role_heading: Type Property
path: avfoundation/avcapturedevice/userpreferredcamera
---

# userPreferredCamera

A camera the user prefers to use for video and photo capture.

## Declaration

```swift
class var userPreferredCamera: AVCaptureDevice? { get set }
```

## Discussion

Discussion In addition to being a systemPreferredCamera, you can designate a device as a user-preferred camera. Setting a value for this property allows an app to persist its preference across app launches and system reboots. The system internally maintains a short history of devices, so if a user’s most recently preferred camera isn’t currently connected, it still reports the next best choice. This property always returns a device that’s present. If no camera is available, this value is nil. note: Setting the value to nil has no effect.

## See Also

### Supporting Continuity Camera

- [systemPreferredCamera](avfoundation/avcapturedevice/systempreferredcamera.md)
- [isContinuityCamera](avfoundation/avcapturedevice/iscontinuitycamera.md)
- [companionDeskViewCamera](avfoundation/avcapturedevice/companiondeskviewcamera.md)
