<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VisionKit",
  "identifier" : "/documentation/VisionKit/DataScannerViewController/RecognizedDataType/text(languages:textContentType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "VisionKit"
    ],
    "preciseIdentifier" : "s:9VisionKit25DataScannerViewControllerC010RecognizedC4TypeV4text9languages0i7ContentH0AESaySSG_AC04TextkH0OSgtFZ"
  },
  "title" : "text(languages:textContentType:)"
}
-->

# text(languages:textContentType:)

Creates a data type for text and information the scanner finds in
text.

```
static func text(languages: [String] = [], textContentType: DataScannerViewController.TextContentType? = nil) -> DataScannerViewController.RecognizedDataType
```

## Parameters

`languages`

The identifiers for the languages that you want
prioritized in the order of language processing. To specify a
person’s preferred languages, pass an empty set. This parameter gives the scanner
a hint on which language processing models to use. The scanner still recognizes all
supported languages.

`textContentType`

The specific type of semantic text to find. To
identify all content types, pass `nil`.

## Return Value

A text data type.

## Discussion

Use this method to create a custom text data type. For example, if
you know the content contains languages other than a person’s
preferred languages, pass identifiers for those languages as the
`languages` parameter. If you only want to scan for telephone
numbers, pass
[`DataScannerViewController.TextContentType.telephoneNumber`](/documentation/VisionKit/DataScannerViewController/TextContentType/telephoneNumber) as the
`textContentType` parameter.

To get the data scanner supported languages, use the
[`supportedTextRecognitionLanguages`](/documentation/VisionKit/DataScannerViewController/supportedTextRecognitionLanguages)
property.

---

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)