---
title: "dataScanner(_:becameUnavailableWithError:)"
framework: visionkit
role: symbol
role_heading: Instance Method
path: "visionkit/datascannerviewcontrollerdelegate/datascanner(_:becameunavailablewitherror:)"
---

# dataScanner(_:becameUnavailableWithError:)

Responds when the data scanner becomes unavailable and stops scanning.

## Declaration

```swift
@MainActor func dataScanner(_ dataScanner: DataScannerViewController, becameUnavailableWithError error: DataScannerViewController.ScanningUnavailable)
```

## Parameters

- `dataScanner`: The data scanner that’s not available.
- `error`: Describes an error if it occurs.

## Mentioned in

Scanning data with the camera
