README.md

# Managing Contacts
Managing containers, groups, and contacts using the Contacts framework
This sample demonstrates how to manage containers, groups, and contacts using the Contacts framework. It implements the following features:
+ Check and request access to the Contacts application and observe changes using CNContactStoreDidChangeNotification.
+ Fetch the default container, all containers, all groups per container, all contacts per container, and the container with a given identifier.
+ Fetch all groups, all contacts per group, the group with a given identifier, and the container that contains a given group.
+ Fetch all contacts, contacts matching a given name, and a contact with a given identifier.
+ Add, update, and delete contacts and groups. Describes best practices when updating and deleting them.
+ Add and remove an existing contact from an existing group.
+ Perform batching multiple changes into a single save request.
+ Show how to use CNContact's isKeyAvailable.
+ Retrieve and update the following properties of a contact: familyName, givenName,organizationName, emailAddresses, imageData, thumbnailImageData, phoneNumbers, and postalAddresses.
 
 
## Requirements
 
### Build
 
Xcode 8.0 or later; iOS 10.0 SDK or later
 
### Runtime
 
iOS 9.3 or later
 
## Usage
This sample requires access to Contacts and Photos services.
ManagingContacts consists of three tabs: Containers, Groups, and Contacts.
Containers allows you to fetch the default container, all containers, groups per container, and contacts per container.
Groups allows you to fetch all groups, contacts per group, add a group, update a group, delete a group, add a contact to a group, and remove a contact from a group.
Contacts allows you to fetch all contacts, contacts matching a name, add a contact, update a contact, and delete a contact.
ManagingContacts uses data from the Menu.plist file and the availability of contact, container, and group information to provide a navigation menu for each of the above tabs.
Grant access to Contacts when prompted upon launching the app. Doing so ensures that you would able to access these data. The app will not show any data if you have denied access to
Contacts. To enable Contacts access for ManagingContacts, navigate to Settings > Privacy > Contacts on your device then tap its associated switch.
See [CNContactViewController](https://developer.apple.com/reference/contactsui/cncontactviewcontroller), if you wish to add, edit, or remove your contacts via a UI.
 
Copyright (C) 2017 Apple Inc. All rights reserved.