Address Book Interface
The Address Book UI framework puts a user interface in front of common tasks involving the address book database and its manipulation by means of the functions and data types discussed in the preceding section. This is a great help, because designing your own interface to do the same thing would be tedious and involved, especially given properties with multiple values and the added complexity of addresses. The framework provides four UIViewController subclasses:
-
ABPeoplePickerNavigationController - Presents a navigation interface, effectively the same as the Contacts app but without an Edit button: it lists the people in the database and allows the user to pick one and view the details.
-
ABPersonViewControllerABNewPersonViewControllerABUnknownPersonViewController Presents an interface showing, respectively:
- The properties of a specific person, possibly editable
- The editable properties of a new person
- A proposed person with a partial set of noneditable properties
ABPeoplePickerNavigationController
An ABPeoplePickerNavigationController is a UINavigationController. Presenting it can be as simple as instantiating it, assigning it a delegate, and showing it modally. (On the iPad, you’ll probably use a popover; presenting the controller modally does work, but a popover looks better. For code that does both, see Example 29-1.) The user can survey groups and the names of all contacts in each:
ABPeoplePickerNavigationController* picker = [[ABPeoplePickerNavigationController ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access