photokit

Generate SwiftUI PhotosPicker code for selecting, loading, and saving photos.

4|1|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill photokit-autisticaf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: photokit
Source: https://github.com/AutisticAF/claude-code-apple-dev-plugin/tree/main/skills/photokit
Command: npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill photokit-autisticaf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Accessing and manipulating the user's photo library requires choosing the right API, handling permissions, loading images efficiently, and supporting iCloud assets without degrading UX. This Skill consolidates patterns for picking media, fetching PHAsset collections, loading images at appropriate quality, caching thumbnails, observing library changes, and saving content safely.

Core Features & Use Cases

  • PhotosPicker & PHPicker: Use PhotosPicker for SwiftUI apps and PHPickerViewController for UIKit to pick media without requesting full library permission.
  • PHPhotoLibrary & Authorization: Request readWrite, addOnly, or handle limited access when you need programmatic browsing, saving, or observing.
  • Image Loading & Caching: Use PHImageManager for single requests and PHCachingImageManager for scrolling grids; respect degraded callbacks and allow network access for iCloud.
  • Observing & Saving: Register PHPhotoLibraryChangeObserver for incremental UI updates and use performChanges for creating assets.
  • Privacy & Plist: Ensure NSPhotoLibraryUsageDescription and NSPhotoLibraryAddUsageDescription are present to avoid runtime failures.

Quick Start

Use the photokit skill to generate SwiftUI PhotosPicker code that selects images, loads high-quality previews with PHImageManager, and saves chosen photos to the library while handling authorization and Info.plist privacy keys.

Frequently Asked Questions about photokit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement PhotosPicker in SwiftUI to select images without requesting full photo library access?

PhotosPicker in SwiftUI lets users select media without full library permission. This Skill provides patterns for configuring PHPickerViewController for UIKit and SwiftUI PhotosPicker, handling selections, and loading previews securely.

What's the difference between PHPhotoLibrary authorization levels like readWrite, addOnly, and limited?

PHPhotoLibrary authorization levels control access: readWrite allows browsing and modifying, addOnly permits saving assets, and limited restricts access to selected photos. This Skill maps permission requests to appropriate programmatic operations.

How do I load and cache PHAsset images efficiently for scrolling grids in iOS?

Loading and caching PHAsset images for scrolling grids requires PHCachingImageManager to prefetch thumbnails and respect degraded callbacks. This Skill demonstrates high-quality image loading strategies optimized for smooth scrolling performance.

Why does my iOS app crash when accessing the photo library without Info.plist privacy keys?

Photo library access crashes occur when NSPhotoLibraryUsageDescription and NSPhotoLibraryAddUsageDescription privacy keys are missing from Info.plist. This Skill ensures proper privacy declarations and iCloud network access configuration.

Can I observe photo library changes and save images programmatically using PHPhotoLibrary?

Observing photo library changes uses PHPhotoLibraryChangeObserver for incremental UI updates, while saving images programmatically requires performChanges to create assets. This Skill provides patterns for both observing and safe content saving.

Does PHImageManager support loading iCloud assets and handling network access for remote photos?

PHImageManager supports iCloud assets by allowing network access for remote photo loading and handling degraded callbacks during fetching. This Skill covers requesting appropriate image quality and respecting network access requirements.