---
title: "captureSession(_:didEndWith:error:)"
framework: roomplan
role: symbol
role_heading: Instance Method
path: "roomplan/roomcapturesessiondelegate/capturesession(_:didendwith:error:)"
---

# captureSession(_:didEndWith:error:)

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

## Declaration

```swift
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.

## Mentioned in

Scanning the rooms of a single structure
