<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RoomPlan",
  "identifier" : "/documentation/RoomPlan/RoomCaptureView/init(frame:arSession:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RoomPlan"
    ],
    "preciseIdentifier" : "s:8RoomPlan0A11CaptureViewC5frame9arSessionACSo6CGRectV_So9ARSessionCtcfc"
  },
  "title" : "init(frame:arSession:)"
}
-->

# init(frame:arSession:)

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

```
@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

By providing your own <doc://com.apple.documentation/documentation/ARKit/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`](/documentation/RoomPlan/CapturedRoom) objects into a single captured structure. For more information, see [`CapturedStructure`](/documentation/RoomPlan/CapturedStructure).

You can access the `arSession` at runtime through this class’s room-capture session ([`captureSession`](/documentation/RoomPlan/RoomCaptureView/captureSession)) property. See the [`RoomCaptureSession`](/documentation/RoomPlan/RoomCaptureSession) property [`arSession`](/documentation/RoomPlan/RoomCaptureSession/arSession).

---

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)