Search code examples
iosios9contactscncontact

Getting all CNGroups from CNContactStore


It seems that there is no way to get the groups from a CNContactStore. The CNContactStore uses a predicate that requires the group identifier to get the group. CNContact does not have any way to find out what group it is in (that I can find).

Is there something I am missing in the documentation? It would really help to be able to see all the available groups in a contact store, and I find it difficult to believe that it isn't possible.


Solution

  • Is there something I am missing in the documentation

    Yes. What you are missing in the documentation is the documentation, which tells you the answer:

    Pass a nil predicate to fetch all groups.