<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DataDetection",
  "identifier" : "/documentation/DataDetection/DataDetector/Options",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "DataDetection"
    ],
    "preciseIdentifier" : "s:13DataDetection0A8DetectorO7OptionsV"
  },
  "title" : "DataDetector.Options"
}
-->

# DataDetector.Options

A set of options you can use to refine the behavior of text scanning, and better interpret the semantic domain of the matches.

```
struct Options
```

## Overview

These properties are only hints, so it’s best to not make assumptions about how the framework uses them:

- Set `documentDate` to the creation date of the scanned string, such as a text message reception date. The default is now.
- Set `documentTimeZone` to the time zone matching the `documentDate`. The default is a person’s current time zone.
- Set `documentLanguageCode` to the language code of the scanned string, for example, “en” for English.
  Only set this property if you know the target language with a high degree of confidence; otherwise, set to `nil`.
- Set `documentRegion` to the region relevant to the scanned string, if any.
  Only set this property if you know the region with a high degree of confidence; otherwise, set to `nil`.

## Topics

### Hints you can provide to add more context for the matching process

[`var documentDate: Date?`](/documentation/DataDetection/DataDetector/Options/documentDate)

The creation date of the scanned string.

[`var documentLanguageCode: Locale.LanguageCode?`](/documentation/DataDetection/DataDetector/Options/documentLanguageCode)

An optional value that represents the language code of a specific locale.

[`var documentRegion: Locale.Region?`](/documentation/DataDetection/DataDetector/Options/documentRegion)

A locale region that’s relevant to the scanned string.

[`var documentTimeZone: TimeZone?`](/documentation/DataDetection/DataDetector/Options/documentTimeZone)

A date that represents the date of the scanned string.

### Initializers

[`init()`](/documentation/DataDetection/DataDetector/Options/init())

Initializes a new data detector.

## Relationships

### Conforms To

[`Escapable`](/documentation/Swift/Escapable)

[`Decodable`](/documentation/Swift/Decodable)

[`Equatable`](/documentation/Swift/Equatable)

[`Encodable`](/documentation/Swift/Encodable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Copyable`](/documentation/Swift/Copyable)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

---

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)