<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextSearching-3wkjv/DocumentIdentifier",
  "metadataVersion" : "0.1.0",
  "role" : "Associated Type",
  "symbol" : {
    "kind" : "Associated Type",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:5UIKit15UITextSearchingP18DocumentIdentifierQa"
  },
  "title" : "DocumentIdentifier"
}
-->

# DocumentIdentifier

An object that uniquely identifies a specific document when searching for matching text across multiple documents.

```
associatedtype DocumentIdentifier : Hashable = AnyHashable?
```

## Discussion

The [`UITextSearching`](/documentation/UIKit/UITextSearching-53wjq) and [`UITextSearchAggregator`](/documentation/UIKit/UITextSearchAggregator-swift.struct) protocols use this type to distinguish matches in a specific document from text in other documents with the same range.

---

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)