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.

Screen Shot 2020-03-31 at 9.29.17 AM

I tried searching the web, YouTube, etc. and all the examples / explanations were far too complicated.

Thanks.

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

https://www.raywenderlich.com/2547730-contacts-framework-tutorial-for-ios

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?

Thx!

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.

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.

groups

You can find it here: Apple Developer Documentation

Good luck!

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

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

Lucky Patcher Kodi nox

This topic was automatically closed after 166 days. New replies are no longer allowed.