---
title: "dataScanner(_:didAdd:allItems:)"
framework: visionkit
role: symbol
role_heading: Instance Method
path: "visionkit/datascannerviewcontrollerdelegate/datascanner(_:didadd:allitems:)"
---

# dataScanner(_:didAdd:allItems:)

Responds when the data scanner starts recognizing an item.

## Declaration

```swift
@MainActor func dataScanner(_ dataScanner: DataScannerViewController, didAdd addedItems: [RecognizedItem], allItems: [RecognizedItem])
```

## Parameters

- `dataScanner`: The data scanner that recognizes the item.
- `addedItems`: The items that the data scanner starts tracking.
- `allItems`: The current items that the data scanner tracks. Text items appear in the reading order of the language and region.

## Mentioned in

Scanning data with the camera

## Discussion

Discussion To identify an item in the addedItems and allItems parameters, use the item’s id property.

## See Also

### Customizing highlighting

- [dataScanner(_:didUpdate:allItems:)](visionkit/datascannerviewcontrollerdelegate/datascanner(_:didupdate:allitems:).md)
- [dataScanner(_:didRemove:allItems:)](visionkit/datascannerviewcontrollerdelegate/datascanner(_:didremove:allitems:).md)
