---
title: "init(frame:arSession:)"
framework: roomplan
role: symbol
role_heading: Initializer
path: "roomplan/roomcaptureview/init(frame:arsession:)"
---

# init(frame:arSession:)

Creates a room-capture view with the given AR session.

## Declaration

```swift
@MainActor @preconcurrency init(frame: CGRect, arSession: ARSession)
```

## Parameters

- `frame`: A structure that positions and shapes the view.
- `arSession`: A world-tracking session that your app creates and runs with an doc://com.apple.documentation/documentation/ARKit/ARWorldTrackingConfiguration before calling this function. If you pass an ARSession instance, RoomPlan preserves all of the AR session’s settings.

## Discussion

Discussion By providing your own ARSession object, you can continue your app’s existing AR experience by seamlessly transitioning into a room-scanning session wtih RoomPlan. In addition, continuing an ARSession across multiple room-capture sessions — specifically, different rooms in the same vicinity — enables you to merge multiple CapturedRoom objects into a single captured structure. For more information, see CapturedStructure. You can access the arSession at runtime through this class’s room-capture session (captureSession) property. See the RoomCaptureSession property arSession.

## See Also

### Creating a room-capture view

- [init(frame:)](roomplan/roomcaptureview/init(frame:).md)
- [init(coder:)](roomplan/roomcaptureview/init(coder:).md)
