---
title: "cameraAnchor(isActive:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/cameraanchor(isactive:)"
---

# cameraAnchor(isActive:)

Specifies the view that should act as the virtual camera for Apple Vision Pro 2D Persona stream.

## Declaration

```swift
@MainActor func cameraAnchor(isActive: Bool = true) -> some View

```

## Parameters

- `isActive`: Whether or not the camera anchor is active. You can use this value to ensure that only one camera anchor is active at a time if you want to create multiple views that could act as the anchor in your app.

## Discussion

Discussion This modifier can be used by visionOS apps to specify the placement of the virtual camera used to create a 2D stream of the user’s Persona. For example, a video conferencing app might add this modifier to the view that shows the other participants during a call. Then when the participant on visionOS looks at that view their Persona will make eye contact with the other participants on the call. The anchor will be at the center of the modified View. ExampleAppVideoView()     .cameraAnchor() You might want to create multiple views with an anchor and then only activate the one that has focus. struct ExampleSelfPreviewWhenFocusedView: View {    @Environment(\.isFocused) var isFocused: Bool

var body: some View {        ExampleAppVideoView()         #if os(visionOS)             .cameraAnchor(isActive: isFocused)         #endif    } } important: You should avoid creating multiple views with simultaneously active camera anchors. If multiple views with active camera anchors are found, the first created will have its parent View be used as the camera anchor, and a runtime error will be emitted.

## See Also

### Displaying media

- [CameraView](homekit/cameraview.md)
- [NowPlayingView](watchkit/nowplayingview.md)
- [VideoPlayer](avkit/videoplayer.md)
- [continuityDevicePicker(isPresented:onDidConnect:)](swiftui/view/continuitydevicepicker(ispresented:ondidconnect:).md)
- [foveatedStreamingPauseSheet(session:)](swiftui/view/foveatedstreamingpausesheet(session:).md)
