<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RoomPlan",
  "identifier" : "/documentation/RoomPlan/RoomCaptureSessionDelegate/captureSession(_:didEndWith:error:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RoomPlan"
    ],
    "preciseIdentifier" : "s:8RoomPlan0A22CaptureSessionDelegateP07captureD0_10didEndWith5erroryAA0acD0C_AA08CapturedA4DataVs5Error_pSgtF"
  },
  "title" : "captureSession(_:didEndWith:error:)"
}
-->

# captureSession(_:didEndWith:error:)

Notifies the delegate of completion with either scan results or an error.

```
func captureSession(_ session: RoomCaptureSession, didEndWith data: CapturedRoomData, error: (any Error)?)
```

## Parameters

`session`

An object that manages the room-scanning process.

`data`

A data object that contains the raw scan results.

`error`

An object that describes the problem when an error occurs; otherwise, `nil`.

---

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)