← ClaudeAtlas

contacts-frameworklisted

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.
dpearson2699/swift-ios-skills · ★ 730 · AI & Automation · score 80
Install: claude install-skill dpearson2699/swift-ios-skills
# Contacts Framework Fetch, create, update, and pick contacts from the user's Contacts database using `CNContactStore`, `CNSaveRequest`, and `CNContactPickerViewController`. Targets Swift 6.3 / iOS 26+. ## Contents - [Setup](#setup) - [Authorization](#authorization) - [Fetching Contacts](#fetching-contacts) - [Key Descriptors](#key-descriptors) - [Creating and Updating Contacts](#creating-and-updating-contacts) - [Contact Picker](#contact-picker) - [Observing Changes](#observing-changes) - [Common Mistakes](#common-mistakes) - [Review Checklist](#review-checklist) - [References](#references) ## Setup ### Project Configuration 1. Add `NSContactsUsageDescription` to Info.plist explaining why the app accesses contacts 2. No additional capability or entitlement is required for basic Contacts access 3. For contact notes access, add the `com.apple.developer.contacts.notes` entitlement ### Imports ```swift import Contacts // CNContactStore, CNSaveRequest, CNContact import ContactsUI // CNContactPickerViewController ``` ## 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. ```swift let store = CNContactStore() func requestAccess() async throws -> Bool { return try await store.requestAccess(for: .contacts) } // Check current status without prompting func checkStatus() -> CNAuthorizationStatus { CNCon