Instance Method

unifiedMeContactWithKeys(toFetch:)

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

Declaration

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

Parameters

keys

The properties to fetch in the returned CNContact object.

error

Error information, if an error occurred.

Return Value

The unified contact that is the "me" card or nil if no "me" card is set.

Discussion

In the user interface, the "me" contact is represented by "My Card." It is recommended that you fetch only the properties you expect to use. You can combine contact keys and contact key descriptors together.

See Also

Fetching Contacts

func enumerateContacts(with: CNContactFetchRequest, usingBlock: (CNContact, UnsafeMutablePointer<ObjCBool>) -> Void)

Returns a Boolean value that indicates whether the enumeration of all contacts matching a contact fetch request executed successfully.

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

Fetches a unified contact for the specified contact identifier.

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

Fetches all unified contacts matching the specified predicate.