<!--
{
  "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/AVCaptureDevice/focusRectOfInterest",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureDevice(py)focusRectOfInterest"
  },
  "title" : "focusRectOfInterest"
}
-->

# focusRectOfInterest

The device’s current focus rectangle of interest, if it has one.

```
var focusRectOfInterest: CGRect { get set }
```

## Discussion

The value of this property is a `CGRect` determining the device’s focus rectangle of interest. Use this as an alternative to setting [`focusPointOfInterest`](/documentation/AVFoundation/AVCaptureDevice/focusPointOfInterest), as it allows you to specify both a location and size. For example, a value of `CGRectMake(0, 0, 1, 1)` tells the device to use the entire field of view when determining the focus, while `CGRectMake(0, 0, 0.25, 0.25)` indicates the top left sixteenth, and `CGRectMake(0.75, 0.75, 0.25, 0.25)` indicates the bottom right sixteenth. Setting [`focusRectOfInterest`](/documentation/AVFoundation/AVCaptureDevice/focusRectOfInterest) throws an `NSInvalidArgumentException` if [`isFocusRectOfInterestSupported`](/documentation/AVFoundation/AVCaptureDevice/isFocusRectOfInterestSupported) returns `false`. Setting [`focusRectOfInterest`](/documentation/AVFoundation/AVCaptureDevice/focusRectOfInterest) throws an `NSInvalidArgumentException` if your provided rectangle’s size is smaller than the [`minFocusRectOfInterestSize`](/documentation/AVFoundation/AVCaptureDevice/minFocusRectOfInterestSize). Setting [`focusRectOfInterest`](/documentation/AVFoundation/AVCaptureDevice/focusRectOfInterest) throws an `NSGenericException` if you call it without first obtaining exclusive access to the device using [`lockForConfiguration()`](/documentation/AVFoundation/AVCaptureDevice/lockForConfiguration()). Setting [`focusRectOfInterest`](/documentation/AVFoundation/AVCaptureDevice/focusRectOfInterest) updates the device’s [`focusPointOfInterest`](/documentation/AVFoundation/AVCaptureDevice/focusPointOfInterest) to the center of your provided rectangle of interest. If you later set the device’s [`focusPointOfInterest`](/documentation/AVFoundation/AVCaptureDevice/focusPointOfInterest), the [`focusRectOfInterest`](/documentation/AVFoundation/AVCaptureDevice/focusRectOfInterest) resets to the default sized rectangle of interest for the new focus point of interest. If you change your [`activeFormat`](/documentation/AVFoundation/AVCaptureDevice/activeFormat), the point of interest and rectangle of interest both revert to their default values. You can observe automatic changes to the device’s [`focusRectOfInterest`](/documentation/AVFoundation/AVCaptureDevice/focusRectOfInterest) by key-value observing this property.

> Note: Setting ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice/focusRectOfInterest`` alone does not initiate a focus operation. After setting ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice/focusRectOfInterest``, set ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice/focusMode-swift.property`` to apply the new rectangle of interest.

---

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)