An object that defines the options to use when fetching contacts.


class CNContactFetchRequest : CNFetchRequest


You need at least one contact property key to fetch a contact’s properties. Use this class with the enumerateContacts(with:usingBlock:) method to execute the contact fetch request.


Creating a Fetch Request

init(keysToFetch: [CNKeyDescriptor])

Creates a fetch request for the specified keys.

Specifying the Search Predicate

var predicate: NSPredicate?

The predicate to match contacts against.

Configuring the Fetch Options

var mutableObjects: Bool

A Boolean value that indicates whether to return mutable contacts.

var unifyResults: Bool

A Boolean value that indicates whether to return linked contacts as unified contacts.

var sortOrder: CNContactSortOrder

The sort order for contacts.

enum CNContactSortOrder

Indicates the sorting order for contacts.

Specifying the Keys to Fetch

var keysToFetch: [CNKeyDescriptor]

The properties to fetch in the returned contacts.


Inherits From

See Also

Fetch and Save Requests

class CNSaveRequest

An object that collects the changes you want to save to the user's contacts database.