O'Reilly logo

Mastering iOS 11 Programming - Second Edition by Donny Wals

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fetching a user's contacts

The introductory section of this chapter mentioned that you would use Contacts.framework to fetch a user's contacts list and display it in a UITableView.

Before we can display such a list, we must be sure we have access to the user's address book. Apple is very restrictive about the privacy of their users, if your app needs access to a user's contacts, camera, location, and more, you need to specify this in your application's Info.plist file. If you fail to specify the correct keys for the data your application uses, it will crash without warning. So, before attempting to load your user's contacts, you should take care of adding the correct key to Info.plist.

To add the key to access a user's contacts, open Info.plist ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required