Agent skill · software engineering · dpearson2699
photokit
Implement, review, or improve photo picking, camera capture, and media handling in iOS apps using PhotoKit and AVFoundation. Use when working with PhotosPicker, PHPickerViewController, camera capture sessions (AVCaptureSession), photo library access, image loading and display, video recording, or media permissions. Also use when selecting photos from the library, taking pictures, recording video, processing images, or handling photo/camera privacy permissions in Swift apps.
Why this skill is useful
Provides specific patterns and code examples for using PhotoKit and AVFoundation that are not widely documented.
What it needs
Requires xcode installed locally. About 7k tokens when loaded. Last updated 2026-07-31. 973 stars on the source repository.
What this skill does
PhotoKit Modern patterns for photo picking, camera capture, image loading, and media permissions targeting iOS 26+ with Swift 6.3. Patterns are backward-compatible to iOS 16 unless noted. See references/photokit-patterns.md for complete picker recipes and references/camera-capture.md for AVCaptureSession patterns. Contents PhotosPicker (SwiftUI, iOS 16+) Privacy and Permissions Camera Capture Basics Image Loading and Display Common Mistakes Review Checklist References PhotosPicker (SwiftUI, iOS 16+) PhotosPicker is the native SwiftUI replacement for UIImagePickerController. It runs out-of-process, requires no photo library permission for browsing, and supports single or multi-selection with media type filtering. Single Selection Multi-Selection Media Type Filtering Filter with PHPickerFilter composites to restrict selectable media: Loading Selected Items with Transferable PhotosPickerItem loads content asynchronously via loadTransferable(type:). Define a Transferable type for automatic decoding: Always load in a Task to avoid blocking the main thread. Handle nil returns and thrown errors -- the user may select a format that cannot be decoded. Privacy and Permissions Photo Library Access Levels iOS provides two access levels for the photo library. The system automatically presents the limited-library picker when an app requests .readWrite access -- users choose which photos to share. Access Level Description Info.plist Key ------------- ------------- ---------------- Add-only Write photos to the library without reading NSPhotoLibraryAddUsageDescription Read-write Full or limited read access plus write NSPhotoLibraryUsageDescription PhotosPicker requires no permission to browse -- it runs out-of-process and only grants access to selected items. Request explicit permission only when you need to read the full library (e.g., a custom gallery) or save photos. Checking and Requesting Photo Library Permission Camera Permission Add NSCameraUsageDescription to Info.plist. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills dpearson2699/photokit