---
title: "captureTextFromCamera(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiresponder/capturetextfromcamera(_:)"
---

# captureTextFromCamera(_:)

Starts scanning text using the device’s camera.

## Declaration

```swift
func captureTextFromCamera(_ sender: Any?)
```

## Parameters

- `sender`: The object that invokes this method.

## Discussion

Discussion To receive callbacks from the data scanner, the responder should conform to either the UIKeyInput or UITextInput protocol. If it conforms to UIKeyInput, the scanner calls the insertText: protocol method. If it conforms to UITextInput, the scanner calls the setMarkedText(_:selectedRange:) and unmarkText() protocol methods. To determine whether the data scanner runs on the user’s device, pass captureTextFromCamera(_:) to the canPerformAction(_:withSender:) method.

## See Also

### Related Documentation

- [Scanning data with the camera](visionkit/scanning-data-with-the-camera.md)
