Instance Method

unifiedContact(withIdentifier:keysToFetch:)

Fetches a unified contact for the specified contact identifier.

Declaration

func unifiedContact(withIdentifier identifier: String, keysToFetch keys: [CNKeyDescriptor]) throws -> CNContact

Parameters

identifier

The identifier of the contact to fetch.

keys

The properties to fetch in the returned CNContact object.

error

Error information, if an error occurred.

Return Value

A unified contact matching or linked to the identifier.

Discussion

Due to unification, the returned contact may have a different identifier than you specify. To fetch a batch of contacts by identifiers, use predicateForContacts(withIdentifiers:) with unifiedContacts(matching:keysToFetch:). It is recommended to fetch only the properties that will be used. You can combine contact keys and contact key descriptors together.

See Also

Fetching Unified Contacts

func unifiedMeContactWithKeys(toFetch: [CNKeyDescriptor]) -> CNContact

Fetches the unified contact that is the "me" card.

func unifiedContacts(matching: NSPredicate, keysToFetch: [CNKeyDescriptor]) -> [CNContact]

Fetches all unified contacts matching the specified predicate.