Community-maintained Agent Skills for complete Swift and Apple-platform app delivery.
72
90%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Medium
Suggest reviewing before use
Build media selection, camera capture, photo library queries, and image caching workflows with PhotosUI (PhotosPicker), PhotoKit (PHPhotoLibrary), and AVFoundation. Targets Swift 6.3 / iOS 26+.
| Approach | UI Framework | Permissions Needed | Use Case |
|---|---|---|---|
PhotosPicker | SwiftUI | None (runs out-of-process) | User selects photos/videos for import |
PHPickerViewController | UIKit | None (runs out-of-process) | UIKit equivalent of PhotosPicker |
PHPhotoLibrary | Direct API | NSPhotoLibraryUsageDescription | Custom gallery, background sync, asset deletion |
AVCaptureSession | Custom UI | NSCameraUsageDescription | Real-time camera viewfinder, photo/video capture |
Prefer PhotosPicker for standard media selection. It preserves user privacy and eliminates permission friction.
When accessing PHPhotoLibrary directly, request authorization and handle .limited access:
let status = await PHPhotoLibrary.requestAuthorization(for: .readWrite)
switch status {
case .authorized:
// Full photo library access granted
case .limited:
// User selected specific photos (present PHPhotoLibrary.shared().presentLimitedLibraryPicker)
case .denied, .restricted:
// Direct user to Settings
case .notDetermined:
break
@unknown default:
break
}Include NSPhotoLibraryUsageDescription (read/write) or NSPhotoLibraryAddUsageDescription (write-only save) in Info.plist.
Use PHCachingImageManager for fast grid thumbnail generation:
startCachingImages(for:targetSize:contentMode:options:) when scrolling into view.PHImageRequestOptions with deliveryMode = .opportunistic for quick thumbnails followed by high-res data.For custom camera viewfinders using AVCaptureSession:
@MainActor.session.beginConfiguration() and defer { session.commitConfiguration() }.UIViewRepresentable backed by AVCaptureVideoPreviewLayer.PhotosPicker single/multi-selection and media filtering recipes, read PhotosPicker Recipes.PHCachingImageManager, and memory management, read Image Loading and Caching. For format conversion and compression, read Image Formats and Compression.PhotosPicker would suffice without any permissions..highQualityFormat on PHImageRequestOptions for fast-scrolling grids, causing dropped frames.AVCaptureSession.startRunning() or configuration changes on @MainActor..limited photo library access on iOS 14+.UIImage into memory for multiple items simultaneously without downsampling.PhotosPicker preferred over custom library enumeration where appropriateNSPhotoLibraryUsageDescription provided when using PHPhotoLibraryNSCameraUsageDescription provided when using AVCaptureSession.limited photo library authorization handled gracefullyPHCachingImageManager used with preheating for asset collectionsAVCaptureSession configured and started on a serial background queue.tessl-plugin
skills
accessorysetupkit
references
activitykit
adattributionkit
references
alarmkit
references
app-clips
app-intents
app-store-optimization
app-store-review
apple-on-device-ai
appmigrationkit
audioaccessorykit
references
authentication
references
avfoundation-audio
references
avkit
background-processing
references
browserenginekit
callkit
references
carplay
cloudkit
contacts-framework
references
core-bluetooth
references
core-data
core-haptics
references
core-motion
references
core-nfc
references
coreml
references
cryptokit
cryptotokenkit
debugging-instruments
device-integrity
references
energykit
references
eventkit
family-controls
references
financekit
focus-engine
gamekit
git-branching-workflow
references
healthkit
references
homekit
references
ios-accessibility
ios-app-workflow
references
ios-ettrace-performance
ios-localization
ios-memgraph-analysis
ios-networking
ios-simulator
references
metrickit
references
musickit
references
natural-language
paperkit
references
passkit
references
pdfkit
pencilkit
references
permissionkit
references
photokit
push-notifications
quicklook
references
realitykit
references
relevancekit
references
scenekit
sensorkit
shazamkit
references
speech-recognition
references
spritekit
storekit
swift-api-design-guidelines
swift-architecture
references
swift-charts
swift-codable
references
swift-code-review
swift-concurrency
swift-formatstyle
references
swift-language
swift-security
references
swift-testing
swiftdata
swiftlint
swiftui-animation
swiftui-gestures
references
swiftui-layout-components
swiftui-liquid-glass
references
swiftui-patterns
swiftui-performance
swiftui-responsive-layout
swiftui-uikit-interop
swiftui-webkit
tabletopkit
tipkit
vision-framework
weatherkit
references