Group Group Group Group Group Group Group Group Group

Container Help Needed

I am trying to learn the Contacts Framework and would very much appreciate someone explaining the following:

  1. What a container is; and

  2. 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.


@joelcyyz Please check out this tutorial when you get a chance:

I hope it helps!

@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:


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.

You can find it here:

Good luck!

@bdmoakley Thank you, much appreciated…I will dig in and hope that it helps, stay tuned!

i too had this problem
thank you very much for responding guys !

Lucky Patcher Kodi nox