<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIResponder/captureTextFromCamera(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIResponder(im)captureTextFromCamera:"
  },
  "title" : "captureTextFromCamera(_:)"
}
-->

# captureTextFromCamera(_:)

Starts scanning text using the device’s camera.

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

## Parameters

`sender`

The object that invokes this method.

## Discussion

To receive callbacks from the data scanner, the responder should conform to either the [`UIKeyInput`](/documentation/UIKit/UIKeyInput) or [`UITextInput`](/documentation/UIKit/UITextInput) protocol. If it conforms to [`UIKeyInput`](/documentation/UIKit/UIKeyInput), the scanner calls the <doc://com.apple.documentation/documentation/AppKit/NSTextInput/insertText:> protocol method. If it conforms to [`UITextInput`](/documentation/UIKit/UITextInput), the scanner calls the [`setMarkedText(_:selectedRange:)`](/documentation/UIKit/UITextInput/setMarkedText(_:selectedRange:)) and [`unmarkText()`](/documentation/UIKit/UITextInput/unmarkText()) protocol methods.

To determine whether the data scanner runs on the user’s device, pass [`captureTextFromCamera(_:)`](/documentation/UIKit/UIResponder/captureTextFromCamera(_:)) to the [`canPerformAction(_:withSender:)`](/documentation/UIKit/UIResponder/canPerformAction(_:withSender:)) method.

## See Also

  <doc://com.apple.documentation/documentation/VisionKit/scanning-data-with-the-camera>



---

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)