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.
Security Assessment
About contacts-framework
The contacts-framework skill provides comprehensive capabilities for integrating Apple's Contacts and ContactsUI frameworks into Swift applications. It enables developers to read, create, update, and manage contacts from the user's Contacts database through CNContactStore, handle contact picker interactions with CNContactPickerViewController, and manage authorization states including the iOS 18+ limited access mode. This skill solves the common challenge of implementing contact management features while handling the complex authorization flows, data fetching patterns, and framework-specific requirements that Apple's Contacts API demands.
Key capabilities include fetching contacts using predicate-based queries or batch enumeration, creating and updating contact records through CNSaveRequest, implementing contact picker UI in SwiftUI applications, and managing contact access permissions across different authorization states. The skill covers essential operations like fetching by name or identifier, enumerating all contacts efficiently, working with key descriptors to optimize data fetching, and observing contact database changes. It specifically addresses iOS 26+ and Swift 6.3 development, incorporating modern concurrency patterns and the latest authorization models.
This skill is designed for iOS developers building applications that require contact integration, such as messaging apps, CRM tools, social networking platforms, or any application needing access to the user's contact information. It provides practical guidance on project configuration including Info.plist requirements, handling different authorization states from full access to limited access, and avoiding common implementation mistakes. The comprehensive coverage includes setup instructions, authorization flows, fetching patterns, and a review checklist to ensure proper implementation.
FAQ
What iOS version and Swift version does this skill target?
This skill targets Swift 6.3 and iOS 26+, incorporating modern concurrency patterns with async/await and the latest Contacts framework authorization models including limited access mode.
Do I need special permissions or entitlements to access contacts?
You must add NSContactsUsageDescription to Info.plist explaining why your app needs contact access, or the app will crash. No additional capability is required for ordinary access. The com.apple.developer.contacts.notes entitlement is only needed when reading or writing contact notes and requires Apple approval.
Does the contact picker require authorization?
No, CNContactPickerViewController does not require explicit authorization. The system automatically grants access only to the contacts the user selects through the picker interface, making it a privacy-friendly option for contact selection.
What is limited access mode and how should I handle it?
Limited access is an iOS 18+ authorization state where users grant access to selected contacts only. Treat both .authorized and .limited as usable states. With limited access, operations only apply to contacts the user granted or your app created. Use ContactAccessButton or contactAccessPicker to let users add more contacts to your app's access set.
What are key descriptors and why do they matter?
Key descriptors specify which contact properties to fetch from CNContactStore. You must explicitly declare which keys you need (like CNContactGivenNameKey or CNContactPhoneNumbersKey) when fetching contacts. This optimizes performance by loading only required data rather than entire contact records.
Install contacts-framework
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
dpearson2699/swift-ios-skills