Agent skill · software engineering · dpearson2699
contacts-framework
Read, create, update, and pick contacts using the Contacts and ContactsUI frameworks. Use when fetching contact data, saving new contacts, wrapping CNContactPickerViewController in SwiftUI, handling contact permissions, or working with CNContactStore fetch and save requests.
Why this skill is useful
Provides specific commands and patterns for using Contacts and ContactsUI frameworks in Swift, which the AI wouldn't reliably generate on its own.
What it needs
About 7k tokens when loaded. Last updated 2026-07-31. 973 stars on the source repository.
What this skill does
Contacts Framework Use CNContactStore, CNSaveRequest, and CNContactPickerViewController to fetch, create, update, or pick contacts in Swift 6.3 / iOS 26+ apps. Contents Setup Authorization Fetching Contacts Key Descriptors Creating and Updating Contacts Contact Picker Observing Changes Common Mistakes Review Checklist References Setup Project Configuration 1. Add NSContactsUsageDescription to Info.plist explaining why the app accesses contacts. The app crashes if it uses contact data APIs without this key. 2. No additional capability or entitlement is required for ordinary Contacts access. 3. Add com.apple.developer.contacts.notes only when reading or writing CNContactNoteKey / CNContact.note; this entitlement requires Apple approval before public distribution. Imports Authorization Request access before fetching or saving contacts. The picker (CNContactPickerViewController) does not require authorization -- the system grants access only to the contacts the user selects. Authorization States Status Meaning --- --- .notDetermined User has not been prompted yet .authorized Full read/write access granted .denied User denied access; direct to Settings .restricted Parental controls or MDM restrict access .limited iOS 18+: user granted access to selected contacts only Treat both .authorized and .limited as usable Contacts API states. With .limited, fetch, edit, and delete operations only apply to contacts the user granted or the app created. Use ContactAccessButton or contactAccessPicker(isPresented:completionHandler:) to let users add contacts to the app's limited-access set. Fetching Contacts Use unifiedContacts(matching:keysToFetch:) for predicate-based queries. Use enumerateContacts(with:usingBlock:) for batch enumeration of all contacts. For large cached address books, first fetch identifiers, then fetch detailed contacts in batches by identifier. Fetch by Name Fetch by Identifier Enumerate All Contacts Perform I/O-heavy enumeration off the main thread. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills dpearson2699/contacts-framework