<!--
{
  "availability" : [
    "iOS: 27.1.0 -",
    "iPadOS: 27.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVKit",
  "identifier" : "/documentation/AVKit/AVCaptureDeviceDirectionCoordinator/init(view:deviceTypes:changeHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVKit"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureDeviceDirectionCoordinator(im)initWithView:deviceTypes:changeHandler:"
  },
  "title" : "init(view:deviceTypes:changeHandler:)"
}
-->

# init(view:deviceTypes:changeHandler:)

Creates a coordinator that reports the direction cameras face in relation to the specified view.

```
init(view: UIView, deviceTypes: [AVCaptureDevice.DeviceType], changeHandler: ((AVCaptureDeviceDirectionMap) -> Void)? = nil)
```

## Parameters

`view`

The view that camera directions are relative to.

`deviceTypes`

The device types the coordinator considers. It reports no other cameras.

`changeHandler`

A callback the coordinator invokes on the main actor soon after you create it, and again each time a camera changes direction. It receives an [`AVCaptureDeviceDirectionMap`](/documentation/AVKit/AVCaptureDeviceDirectionMap) that groups the cameras by the direction they now face. Pass `nil` to read [`deviceDirections`](/documentation/AVKit/AVCaptureDeviceDirectionCoordinator/deviceDirections) yourself instead of receiving updates. A coordinator keeps the handler it’s created with, so create a new coordinator to change it.

## Discussion> Note: Initialize the coordinator only on the main actor.

---

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)