I am trying to learn the Contacts Framework and would very much appreciate someone explaining the following:
What a container is; and
What a container id is and how they work.
Specifically, in the following code I understand that the constant predicate is used to filter the individual contacts that are fetched and stored in array contacts but I do not understand how / why line 42 and 44 work to filter (i.e. include) all contacts.
I tried searching the web, YouTube, etc. and all the examples / explanations were far too complicated.
@shogunkaramazov, thank you for your two responses, they are much appreciatedā¦I had tripped over that a few days ago, tried to follow it but it was too advanced for me as I am at the VERY EARLY stages of learning Swift on my own (i.e. as a COVID-19 stay busy project)ā¦any suggestions for a somewhat easier to follow / simpler explanation?
The official documentation is always a good place to check. Hereās what it has to say:
Containers
A user may have contacts in their deviceās local account or server accounts configured to sync contacts. Each account has at least one container of contacts. A contact can be in only one container.
A group is a set of contacts within a container. Not all accounts support groups and some accounts support subgroups. An iCloud account has only one container and may have many groups but no subgroups. On the other hand, an Exchange account does not support groups, but may have multiple containers representing Exchange folders.