ContactResolver
protocol · iOS 27.0+ · SDK 27.1
protocol ContactResolver : SendableAn interface you use to help Foundation models resolve references to the person using the app. When a search involves people, the search tool needs to know how to resolve references to “I” or “me” in any conversations. Implement this protocol in a custom type and assign it to the Spotlight search tool you use with your Foundation models session. Your custom type returns a ``ResolvedContact`` structure, which contains any information your app uses to refer to the person. For example, fill the structure with name information, email addresses, or phone numbers from the account your app manages. The following example shows an implementation of this structure and the code you use to assign it to your Spotlight search tool. ```swift struct MyContactResolver: ContactResolver { func userIdentity() -> ResolvedContact { var contact = ResolvedContact(displayName: "John Appleseed") contact.emailAddresses = ["john@example.com"] return contact } } var configuration = SpotlightSearchTool.Configuration() configuration.contactResolver = MyContactResolver() ```
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
No declarations were skipped in this snapshot.