<!--
{
  "availability" : [
    "iOS: 15.0 -",
    "iPadOS: 15.0 -",
    "macCatalyst: 15.0 -",
    "macOS: 12.0 -",
    "tvOS: 15.0 -",
    "visionOS: 1.0 -",
    "watchOS: 8.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DataDetection",
  "identifier" : "/documentation/DataDetection",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "DataDetection"
    ],
    "preciseIdentifier" : "DataDetection"
  },
  "title" : "DataDetection"
}
-->

# DataDetection

Access and utilize common types of data that the data detection system matches.

## Overview

Data detection methods in other frameworks detect common types of data represented in text, and return  DataDetection framework classes that provide semantic meaning for matches. Get relevant, domain-specific information from matches of the following types:

- Calendar events
- Email addresses
- Flight numbers
- Web links
- Amounts of money, with currencies
- Phone numbers
- Postal addresses
- Shipment tracking numbers

Use functions, such as those in <doc://com.apple.documentation/documentation/UIKit/UIPasteboard>, to detect the types of data that you specify in a particular context. For example, find email addresses in a pasteboard using <doc://com.apple.documentation/documentation/UIKit/UIPasteboard/detectValues(for:completionHandler:)-6adre> as this example shows:

```swift
UIPasteboard.general.detectValues(for: [\.emailAddresses]) { [self] result in
    switch result {
    case .success(let detectedValues):
        guard let firstEmailAddressMatch = detectedValues.emailAddresses.first else {
            return
        }
        let newEmailAddress = firstEmailAddressMatch.emailAddress
        let newLabel = firstEmailAddressMatch.label
        addNewEmail(for: contact, address: newEmailAddress, label: newLabel)
    case .failure(let error):
        print("Error detecting email addresses: \(error.localizedDescription)")
    }
}
```

Then, inspect and use the data from objects that the data detection system returns.

## Topics

### Matched strings

[`DDMatch`](/documentation/DataDetection/DDMatch)

A base class for common types of data that the data detection system matches.

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

An extension to the string protocol that scans strings for semantic entities, such as email addresses, phone numbers, URLs, and flight information.

### Matched data types

[`DDMatchCalendarEvent`](/documentation/DataDetection/DDMatchCalendarEvent)

An object that represents a calendar date or date range that the data detection system matches.

[`DDMatchEmailAddress`](/documentation/DataDetection/DDMatchEmailAddress)

An object that contains an email address that the data detection system matches.

[`DDMatchFlightNumber`](/documentation/DataDetection/DDMatchFlightNumber)

An object that contains a flight number that the data detection system matches.

[`DDMatchLink`](/documentation/DataDetection/DDMatchLink)

An object that contains a web link that the data detection system matches.

[`DDMatchMoneyAmount`](/documentation/DataDetection/DDMatchMoneyAmount)

An object that contains an amount of money that the data detection system matches.

[`DDMatchPhoneNumber`](/documentation/DataDetection/DDMatchPhoneNumber)

An object that contains a phone number that the data detection system matches.

[`DDMatchPostalAddress`](/documentation/DataDetection/DDMatchPostalAddress)

An object that contains a postal address that the data detection system matches.

[`DDMatchShipmentTrackingNumber`](/documentation/DataDetection/DDMatchShipmentTrackingNumber)

An object that contains parcel tracking information that the data detection system matches.

### Pasteboard detectors

  <doc://com.apple.documentation/documentation/UIKit/UIPasteboard/detectPatterns(for:completionHandler:)-23vwn>

  <doc://com.apple.documentation/documentation/UIKit/UIPasteboard/detectedPatterns(for:)>

  <doc://com.apple.documentation/documentation/UIKit/UIPasteboard/detectPatterns(for:inItemSet:completionHandler:)-7ubl1>

  <doc://com.apple.documentation/documentation/UIKit/UIPasteboard/detectedPatterns(for:inItemSet:)>

  <doc://com.apple.documentation/documentation/UIKit/UIPasteboard/detectValues(for:completionHandler:)-6adre>

  <doc://com.apple.documentation/documentation/UIKit/UIPasteboard/detectedValues(for:)>

  <doc://com.apple.documentation/documentation/UIKit/UIPasteboard/detectValues(for:inItemSet:completionHandler:)-pm9l>

  <doc://com.apple.documentation/documentation/UIKit/UIPasteboard/detectedValues(for:inItemSet:)>



---

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)