How would i retrieve all containers or all container identifiers from a contact store?

How would i retrieve all containers or all container identifiers from a contact store?


The instance method containers(_:) of the CNContactStore class requires a predicate from one of the class methods of the CNContainer class that returns a predicate.


Here are all the class methods of CNContainer that return a predicate:


class func predicateForContainerOfContact(withIdentifier: String) -> NSPredicate

Returns a predicate to find the container of the specified contact.


class func predicateForContainers(withIdentifiers: [String]) -> NSPredicate

Returns a predicate to find the containers with the specified identifiers.


class func predicateForContainerOfGroup(withIdentifier: String) -> NSPredicate

Returns a predicate to find the container of the specified group.


I need to retrieve all the containers without knowing any of those identifers -- contact identifier, container identifier, or group identifere.


Accepted Reply

Docs say to set predicate to nil to match all..

Replies

Docs say to set predicate to nil to match all..