unifiedMeContactWithKeys(toFetch:)
Fetches the unified contact that’s the me card.
Declaration
func unifiedMeContactWithKeys(toFetch keys: [any CNKeyDescriptor]) throws -> CNContactParameters
- keys:
The properties to fetch in the returned Cncontact object.
Return Value
The unified contact that is the me card or nil if there isn’t one.
Discussion
In the user interface, My Card represents the me contact. Fetch only the properties your app uses. You can combine contact keys and contact key descriptors together.
To include CNContactNoteKey in the array of keys in iOS 13 or later or macOS 13 or later, add the com.apple.developer.contacts.notes entitlement to your app. The entitlement requires permission from Apple to use, and you can’t publicly distribute your app until you have permission to use it. For more information about adding the entitlement and getting permission, see com.apple.developer.contacts.notes.