Instance Method


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


func enumerateContacts(with fetchRequest: CNContactFetchRequest, usingBlock block: @escaping (CNContact, UnsafeMutablePointer<ObjCBool>) -> Void) throws



The contact fetch request that specifies the search criteria.


Error information, if an error occurred.


Called for each contact matching the fetch request.

Return Value

true if enumeration of all contacts matching a contact fetch request executes successfully; otherwise, false.


This method waits until the enumeration is finished. If there are no results, the block is not called and the method returns true.

This method can fetch all contacts without keeping all of them at once in memory, which is expensive.

See Also

Fetching Contacts

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

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

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.