{"id":"d3196396-caa5-4e23-9eee-448d834d7fcc","shortId":"SRzvJG","kind":"skill","title":"photokit","tagline":"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, vi","description":"# PhotoKit\n\nModern 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](references/photokit-patterns.md) for complete picker recipes and [references/camera-capture.md](references/camera-capture.md) for AVCaptureSession patterns.\n\n## Contents\n\n- [PhotosPicker (SwiftUI, iOS 16+)](#photospicker-swiftui-ios-16)\n- [Privacy and Permissions](#privacy-and-permissions)\n- [Camera Capture Basics](#camera-capture-basics)\n- [Image Loading and Display](#image-loading-and-display)\n- [Common Mistakes](#common-mistakes)\n- [Review Checklist](#review-checklist)\n- [References](#references)\n\n## PhotosPicker (SwiftUI, iOS 16+)\n\n`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.\n\n### Single Selection\n\n```swift\nimport SwiftUI\nimport PhotosUI\n\nstruct SinglePhotoPicker: View {\n    @State private var selectedItem: PhotosPickerItem?\n    @State private var selectedImage: Image?\n\n    var body: some View {\n        VStack {\n            if let selectedImage {\n                selectedImage\n                    .resizable()\n                    .scaledToFit()\n                    .frame(maxHeight: 300)\n            }\n\n            PhotosPicker(\"Select Photo\", selection: $selectedItem, matching: .images)\n        }\n        .onChange(of: selectedItem) { _, newItem in\n            Task {\n                if let data = try? await newItem?.loadTransferable(type: Data.self),\n                   let uiImage = UIImage(data: data) {\n                    selectedImage = Image(uiImage: uiImage)\n                }\n            }\n        }\n    }\n}\n```\n\n### Multi-Selection\n\n```swift\nstruct MultiPhotoPicker: View {\n    @State private var selectedItems: [PhotosPickerItem] = []\n    @State private var selectedImages: [Image] = []\n\n    var body: some View {\n        VStack {\n            ScrollView(.horizontal) {\n                HStack {\n                    ForEach(selectedImages.indices, id: \\.self) { index in\n                        selectedImages[index]\n                            .resizable()\n                            .scaledToFill()\n                            .frame(width: 100, height: 100)\n                            .clipShape(RoundedRectangle(cornerRadius: 8))\n                    }\n                }\n            }\n\n            PhotosPicker(\n                \"Select Photos\",\n                selection: $selectedItems,\n                maxSelectionCount: 5,\n                matching: .images\n            )\n        }\n        .onChange(of: selectedItems) { _, newItems in\n            Task {\n                selectedImages = []\n                for item in newItems {\n                    if let data = try? await item.loadTransferable(type: Data.self),\n                       let uiImage = UIImage(data: data) {\n                        selectedImages.append(Image(uiImage: uiImage))\n                    }\n                }\n            }\n        }\n    }\n}\n```\n\n### Media Type Filtering\n\nFilter with `PHPickerFilter` composites to restrict selectable media:\n\n```swift\n// Images only\nPhotosPicker(selection: $items, matching: .images)\n\n// Videos only\nPhotosPicker(selection: $items, matching: .videos)\n\n// Live Photos only\nPhotosPicker(selection: $items, matching: .livePhotos)\n\n// Screenshots only\nPhotosPicker(selection: $items, matching: .screenshots)\n\n// Images and videos combined\nPhotosPicker(selection: $items, matching: .any(of: [.images, .videos]))\n\n// Images excluding screenshots\nPhotosPicker(selection: $items, matching: .all(of: [.images, .not(.screenshots)]))\n```\n\n### Loading Selected Items with Transferable\n\n`PhotosPickerItem` loads content asynchronously via `loadTransferable(type:)`. Define a `Transferable` type for automatic decoding:\n\n```swift\nstruct PickedImage: Transferable {\n    let data: Data\n    let image: Image\n\n    static var transferRepresentation: some TransferRepresentation {\n        DataRepresentation(importedContentType: .image) { data in\n            guard let uiImage = UIImage(data: data) else {\n                throw TransferError.importFailed\n            }\n            return PickedImage(data: data, image: Image(uiImage: uiImage))\n        }\n    }\n}\n\nenum TransferError: Error {\n    case importFailed\n}\n\n// Usage\nif let picked = try? await item.loadTransferable(type: PickedImage.self) {\n    selectedImage = picked.image\n}\n```\n\nAlways 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.\n\n## Privacy and Permissions\n\n### Photo Library Access Levels\n\niOS 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.\n\n| Access Level | Description | Info.plist Key |\n|-------------|-------------|----------------|\n| Add-only | Write photos to the library without reading | `NSPhotoLibraryAddUsageDescription` |\n| Read-write | Full or limited read access plus write | `NSPhotoLibraryUsageDescription` |\n\n`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.\n\n### Checking and Requesting Photo Library Permission\n\n```swift\nimport Photos\n\nfunc requestPhotoLibraryAccess() async -> PHAuthorizationStatus {\n    let status = PHPhotoLibrary.authorizationStatus(for: .readWrite)\n\n    switch status {\n    case .notDetermined:\n        return await PHPhotoLibrary.requestAuthorization(for: .readWrite)\n    case .authorized, .limited:\n        return status\n    case .denied, .restricted:\n        return status\n    @unknown default:\n        return status\n    }\n}\n```\n\n### Camera Permission\n\nAdd `NSCameraUsageDescription` to Info.plist. Check and request access before configuring a capture session:\n\n```swift\nimport AVFoundation\n\nfunc requestCameraAccess() async -> Bool {\n    let status = AVCaptureDevice.authorizationStatus(for: .video)\n\n    switch status {\n    case .notDetermined:\n        return await AVCaptureDevice.requestAccess(for: .video)\n    case .authorized:\n        return true\n    case .denied, .restricted:\n        return false\n    @unknown default:\n        return false\n    }\n}\n```\n\n### Handling Denied Permissions\n\nWhen the user denies access, guide them to Settings. Never repeatedly prompt or hide functionality silently.\n\n```swift\nstruct PermissionDeniedView: View {\n    let message: String\n    @Environment(\\.openURL) private var openURL\n\n    var body: some View {\n        ContentUnavailableView {\n            Label(\"Access Denied\", systemImage: \"lock.shield\")\n        } description: {\n            Text(message)\n        } actions: {\n            Button(\"Open Settings\") {\n                if let url = URL(string: UIApplication.openSettingsURLString) {\n                    openURL(url)\n                }\n            }\n        }\n    }\n}\n```\n\n### Required Info.plist Keys\n\n| Key | When Required |\n|-----|--------------|\n| `NSPhotoLibraryUsageDescription` | Reading photos from the library |\n| `NSPhotoLibraryAddUsageDescription` | Saving photos/videos to the library |\n| `NSCameraUsageDescription` | Accessing the camera |\n| `NSMicrophoneUsageDescription` | Recording audio (video with sound) |\n\nOmitting a required key causes a runtime crash when the permission dialog would appear.\n\n## Camera Capture Basics\n\nManage camera sessions in a dedicated `@Observable` model. The representable view only displays the preview. See [references/camera-capture.md](references/camera-capture.md) for complete patterns.\n\n### Minimal Camera Manager\n\n```swift\nimport AVFoundation\n\n@available(iOS 17.0, *)\n@Observable\n@MainActor\nfinal class CameraManager {\n    let session = AVCaptureSession()\n    private let photoOutput = AVCapturePhotoOutput()\n    private var currentDevice: AVCaptureDevice?\n\n    var isRunning = false\n    var capturedImage: Data?\n\n    func configure() async {\n        guard await requestCameraAccess() else { return }\n\n        session.beginConfiguration()\n        session.sessionPreset = .photo\n\n        // Add camera input\n        guard let device = AVCaptureDevice.default(.builtInWideAngleCamera,\n                                                    for: .video,\n                                                    position: .back) else { return }\n        currentDevice = device\n\n        guard let input = try? AVCaptureDeviceInput(device: device),\n              session.canAddInput(input) else { return }\n        session.addInput(input)\n\n        // Add photo output\n        guard session.canAddOutput(photoOutput) else { return }\n        session.addOutput(photoOutput)\n\n        session.commitConfiguration()\n    }\n\n    func start() {\n        guard !session.isRunning else { return }\n        Task.detached { [session] in\n            session.startRunning()\n        }\n        isRunning = true\n    }\n\n    func stop() {\n        guard session.isRunning else { return }\n        Task.detached { [session] in\n            session.stopRunning()\n        }\n        isRunning = false\n    }\n\n    private func requestCameraAccess() async -> Bool {\n        let status = AVCaptureDevice.authorizationStatus(for: .video)\n        if status == .notDetermined {\n            return await AVCaptureDevice.requestAccess(for: .video)\n        }\n        return status == .authorized\n    }\n}\n```\n\nStart and stop `AVCaptureSession` on a background queue. The `startRunning()` and `stopRunning()` methods are synchronous and block the calling thread.\n\n### Camera Preview in SwiftUI\n\nWrap `AVCaptureVideoPreviewLayer` in a `UIViewRepresentable`. Override `layerClass` for automatic resizing:\n\n```swift\nimport SwiftUI\nimport AVFoundation\n\nstruct CameraPreview: UIViewRepresentable {\n    let session: AVCaptureSession\n\n    func makeUIView(context: Context) -> PreviewView {\n        let view = PreviewView()\n        view.previewLayer.session = session\n        view.previewLayer.videoGravity = .resizeAspectFill\n        return view\n    }\n\n    func updateUIView(_ uiView: PreviewView, context: Context) {\n        if uiView.previewLayer.session !== session {\n            uiView.previewLayer.session = session\n        }\n    }\n}\n\nfinal class PreviewView: UIView {\n    override class var layerClass: AnyClass { AVCaptureVideoPreviewLayer.self }\n    var previewLayer: AVCaptureVideoPreviewLayer { layer as! AVCaptureVideoPreviewLayer }\n}\n```\n\n### Using the Camera in a View\n\n```swift\nstruct CameraScreen: View {\n    @State private var cameraManager = CameraManager()\n\n    var body: some View {\n        ZStack(alignment: .bottom) {\n            CameraPreview(session: cameraManager.session)\n                .ignoresSafeArea()\n\n            Button {\n                // Capture photo -- see references/camera-capture.md\n            } label: {\n                Circle()\n                    .fill(.white)\n                    .frame(width: 72, height: 72)\n                    .overlay(Circle().stroke(.gray, lineWidth: 3))\n            }\n            .padding(.bottom, 32)\n        }\n        .task {\n            await cameraManager.configure()\n            cameraManager.start()\n        }\n        .onDisappear {\n            cameraManager.stop()\n        }\n    }\n}\n```\n\nAlways call `stop()` in `onDisappear`. A running capture session holds the camera exclusively and drains battery.\n\n## Image Loading and Display\n\n### AsyncImage for Remote Images\n\n```swift\nAsyncImage(url: imageURL) { phase in\n    switch phase {\n    case .empty:\n        ProgressView()\n    case .success(let image):\n        image\n            .resizable()\n            .scaledToFill()\n    case .failure:\n        Image(systemName: \"photo\")\n            .foregroundStyle(.secondary)\n    @unknown default:\n        EmptyView()\n    }\n}\n.frame(width: 200, height: 200)\n.clipShape(RoundedRectangle(cornerRadius: 12))\n```\n\n`AsyncImage` does not cache images across view redraws. For production apps with many images, use a dedicated image loading library or `URLCache`-based caching.\n\n### Downsampling Large Images\n\nLoad full-resolution photos from the library into a display-sized `CGImage` to avoid memory spikes. A 48MP photo can consume over 200 MB uncompressed.\n\n```swift\nimport ImageIO\nimport UIKit\n\nfunc downsample(data: Data, to pointSize: CGSize, scale: CGFloat = UITraitCollection.current.displayScale) -> UIImage? {\n    let maxDimensionInPixels = max(pointSize.width, pointSize.height) * scale\n\n    let options: [CFString: Any] = [\n        kCGImageSourceCreateThumbnailFromImageAlways: true,\n        kCGImageSourceShouldCacheImmediately: true,\n        kCGImageSourceCreateThumbnailWithTransform: true,\n        kCGImageSourceThumbnailMaxPixelSize: maxDimensionInPixels\n    ]\n\n    guard let source = CGImageSourceCreateWithData(data as CFData, nil),\n          let cgImage = CGImageSourceCreateThumbnailAtIndex(source, 0, options as CFDictionary) else {\n        return nil\n    }\n\n    return UIImage(cgImage: cgImage)\n}\n```\n\nUse this whenever displaying user-selected photos in lists, grids, or thumbnails. Pass the raw `Data` from `PhotosPickerItem` directly to the downsampler before creating a `UIImage`.\n\n### Image Rendering Modes\n\n```swift\n// Original: display the image as-is with its original colors\nImage(\"photo\")\n    .renderingMode(.original)\n\n// Template: treat the image as a mask, colored by foregroundStyle\nImage(systemName: \"heart.fill\")\n    .renderingMode(.template)\n    .foregroundStyle(.red)\n```\n\nUse `.original` for photos and artwork. Use `.template` for icons that should adopt the current tint color.\n\n## Common Mistakes\n\n**DON'T:** Use `UIImagePickerController` for photo picking.\n**DO:** Use `PhotosPicker` (SwiftUI) or `PHPickerViewController` (UIKit).\n*Why:* `UIImagePickerController` is legacy API with limited functionality. `PhotosPicker` runs out-of-process, supports multi-selection, and requires no library permission for browsing.\n\n**DON'T:** Request full photo library access when you only need the user to pick photos.\n**DO:** Use `PhotosPicker` which requires no permission, or request `.readWrite` and let the system handle limited access.\n*Why:* Full access is unnecessary for most pick-and-use workflows. The system's limited-library picker respects user privacy and still grants access to selected items.\n\n**DON'T:** Load full-resolution images into memory for thumbnails.\n**DO:** Use `CGImageSource` with `kCGImageSourceThumbnailMaxPixelSize` to downsample. A 48MP image is over 200 MB uncompressed.\n\n**DON'T:** Block the main thread loading `PhotosPickerItem` data.\n**DO:** Use `async loadTransferable(type:)` in a `Task`.\n\n**DON'T:** Forget to stop `AVCaptureSession` when the view disappears.\n**DO:** Call `session.stopRunning()` in `onDisappear` or `dismantleUIView`.\n\n**DON'T:** Assume camera access is granted without checking.\n**DO:** Check `AVCaptureDevice.authorizationStatus(for: .video)` and handle `.denied`/`.restricted`.\n\n**DON'T:** Call `session.startRunning()` on the main thread.\n**DO:** Dispatch to a background thread with `Task.detached` or a dedicated serial queue.\n*Why:* `startRunning()` is a synchronous blocking call that can take hundreds of milliseconds while the hardware initializes.\n\n**DON'T:** Create `AVCaptureSession` inside a `UIViewRepresentable`.\n**DO:** Own the session in a separate `@Observable` model.\n\n## Review Checklist\n\n- [ ] `PhotosPicker` used instead of deprecated `UIImagePickerController`\n- [ ] Privacy descriptions in Info.plist for camera/photo library\n- [ ] Loading states handled for async image/video loading\n- [ ] Large images downsampled with `CGImageSource` before display\n- [ ] Camera session started on background thread; stopped in `onDisappear`\n- [ ] Permission denial handled with Settings deep link\n- [ ] `AVCaptureSession` owned by model, not created inside `UIViewRepresentable`\n- [ ] Media asset types and picker results are `Sendable` across concurrency boundaries\n\n## References\n\n- [references/photokit-patterns.md](references/photokit-patterns.md) — Picker patterns, media loading, HEIC handling\n- [references/camera-capture.md](references/camera-capture.md) — AVCaptureSession, photo/video capture, QR scanning\n- [references/image-loading-caching.md](references/image-loading-caching.md) — AsyncImage, caching, downsampling\n- [references/av-playback.md](references/av-playback.md) — AVPlayer, streaming, audio","tags":["photokit","swift","ios","skills","dpearson2699","accessibility","agent-skills","ai-coding","apple","claude-code","codex-skills","cursor-skills"],"capabilities":["skill","source-dpearson2699","skill-photokit","topic-accessibility","topic-agent-skills","topic-ai-coding","topic-apple","topic-claude-code","topic-codex-skills","topic-cursor-skills","topic-ios","topic-ios-development","topic-liquid-glass","topic-localization","topic-mapkit"],"categories":["swift-ios-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/dpearson2699/swift-ios-skills/photokit","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add dpearson2699/swift-ios-skills","source_repo":"https://github.com/dpearson2699/swift-ios-skills","install_from":"skills.sh"}},"qualityScore":"0.684","qualityRationale":"deterministic score 0.68 from registry signals: · indexed on github topic:agent-skills · 468 github stars · SKILL.md body (16,578 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T00:53:44.194Z","embedding":null,"createdAt":"2026-04-18T22:01:11.815Z","updatedAt":"2026-04-22T00:53:44.194Z","lastSeenAt":"2026-04-22T00:53:44.194Z","tsv":"'0':1214 '100':263,265 '12':1113 '16':64,84,89,128 '17.0':793 '200':1107,1109,1165,1431 '26':53 '3':1043 '300':194 '32':1046 '48mp':1160,1427 '5':276 '6.3':56 '72':1035,1037 '8':269 'access':32,476,481,501,508,531,550,623,670,700,738,1352,1378,1381,1404,1472 'across':1119,1601 'action':707 'add':514,616,827,856 'add-on':513 'adopt':1300 'align':1018 'alway':444,1053 'anyclass':990 'api':1325 'app':15,498,1124 'appear':760 'artwork':1293 'as-i':1260 'asset':1594 'assum':1470 'async':584,634,818,894,1445,1559 'asynchron':380 'asyncimag':1073,1078,1114,1622 'audio':743,1629 'author':601,651,911 'automat':389,489,944 'avail':791 'avcapturedevic':809 'avcapturedevice.authorizationstatus':638,898,1479 'avcapturedevice.default':833 'avcapturedevice.requestaccess':647,906 'avcapturedeviceinput':847 'avcapturephotooutput':805 'avcapturesess':29,78,801,915,956,1456,1527,1585,1615 'avcapturevideopreviewlay':937,994,997 'avcapturevideopreviewlayer.self':991 'avfound':19,631,790,950 'avoid':450,1156 'avplay':1627 'await':212,294,438,596,646,820,905,1048 'back':838 'background':918,1498,1573 'backward':60 'backward-compat':59 'base':1136 'basic':99,103,763 'batteri':1068 'block':451,928,1436,1512 'bodi':182,244,695,1014 'bool':635,895 'bottom':1019,1045 'boundari':1603 'brows':149,540,1345 'builtinwideanglecamera':834 'button':708,1024 'cach':1117,1137,1623 'call':930,1054,1462,1488,1513 'camera':8,26,44,97,101,614,740,761,765,786,828,932,1000,1064,1471,1569 'camera-capture-bas':100 'camera/photo':1553 'cameramanag':798,1011,1012 'cameramanager.configure':1049 'cameramanager.session':1022 'cameramanager.start':1050 'cameramanager.stop':1052 'camerapreview':952,1020 'camerascreen':1006 'cannot':468 'captur':9,27,45,98,102,627,762,1025,1060,1617 'capturedimag':814 'case':431,593,600,605,643,650,654,1085,1088,1095 'caus':751 'cfdata':1208 'cfdictionari':1217 'cfstring':1192 'cgfloat':1181 'cgimag':1154,1211,1223,1224 'cgimagesourc':1421,1566 'cgimagesourcecreatethumbnailatindex':1212 'cgimagesourcecreatewithdata':1205 'cgsize':1179 'check':573,620,1476,1478 'checklist':119,122,1541 'choos':503 'circl':1030,1039 'class':797,983,987 'clipshap':266,1110 'color':1266,1278,1304 'combin':351 'common':113,116,1305 'common-mistak':115 'compat':61 'complet':71,783 'composit':313 'concurr':1602 'configur':625,817 'consum':1163 'content':80,379 'contentunavailableview':698 'context':959,960,975,976 'cornerradius':268,1112 'crash':754 'creat':1249,1526,1590 'current':1302 'currentdevic':808,841 'custom':568 'data':210,220,221,292,301,302,396,397,409,415,416,422,423,815,1175,1176,1206,1241,1442 'data.self':216,297 'datarepresent':406 'decod':390,470 'dedic':769,1130,1504 'deep':1583 'default':611,660,1103 'defin':384 'deni':606,655,664,669,701,1484 'denial':1579 'deprec':1546 'descript':510,704,1549 'devic':832,842,848,849 'dialog':758 'direct':1244 'disappear':1460 'dismantleuiview':1467 'dispatch':1495 'display':36,107,112,776,1072,1152,1228,1257,1568 'display-s':1151 'downsampl':1138,1174,1247,1425,1564,1624 'drain':1067 'e.g':566 'els':417,822,839,852,862,871,883,1218 'empti':1086 'emptyview':1104 'enum':428 'environ':689 'error':430,460 'exclud':361 'exclus':1065 'explicit':555 'failur':1096 'fals':658,662,812,890 'fill':1031 'filter':160,309,310 'final':796,982 'foreach':251 'foregroundstyl':1100,1280,1286 'forget':1453 'format':466 'frame':192,261,1033,1105 'full':527,564,1143,1349,1380,1412 'full-resolut':1142,1411 'func':582,632,816,867,879,892,957,971,1173 'function':680,1328 'galleri':569 'grant':549,1403,1474 'gray':1041 'grid':1235 'guard':411,819,830,843,859,869,881,1202 'guid':671 'handl':12,455,663,1376,1483,1557,1580,1612 'hardwar':1522 'heart.fill':1283 'heic':1611 'height':264,1036,1108 'hide':679 'hold':1062 'horizont':249 'hstack':250 'hundr':1517 'icon':1297 'id':253 'ignoressafearea':1023 'imag':33,46,104,109,180,201,223,242,278,304,319,325,348,358,360,369,399,400,408,424,425,1069,1076,1091,1092,1097,1118,1127,1131,1140,1252,1259,1267,1274,1281,1414,1428,1563 'image-loading-and-display':108 'image/video':1560 'imageio':1170 'imageurl':1080 'implement':2 'import':164,166,580,630,789,947,949,1169,1171 'importedcontenttyp':407 'importfail':432 'improv':5 'index':255,258 'info.plist':511,619,720,1551 'initi':1523 'input':829,845,851,855 'insid':1528,1591 'instead':1544 'io':14,52,63,83,88,127,478,792 'isrun':811,877,889 'item':287,323,330,338,345,354,365,374,553,1407 'item.loadtransferable':295,439 'kcgimagesourcecreatethumbnailfromimagealway':1194 'kcgimagesourcecreatethumbnailwithtransform':1198 'kcgimagesourceshouldcacheimmedi':1196 'kcgimagesourcethumbnailmaxpixels':1200,1423 'key':512,721,722,750 'label':699,1029 'larg':1139,1562 'layer':995 'layerclass':942,989 'legaci':1324 'let':187,209,217,291,298,395,398,412,435,586,636,686,712,799,803,831,844,896,954,962,1090,1184,1190,1203,1210,1373 'level':477,482,509 'librari':31,146,475,486,494,520,565,577,730,736,1133,1148,1342,1351,1396,1554 'limit':493,529,602,1327,1377,1395 'limited-librari':492,1394 'linewidth':1042 'link':1584 'list':1234 'live':333 'livephoto':340 'load':34,47,105,110,372,378,445,1070,1132,1141,1410,1440,1555,1561,1610 'loadtransfer':214,382,1446 'lock.shield':703 'main':453,1438,1492 'mainactor':795 'makeuiview':958 'manag':764,787 'mani':1126 'mask':1277 'match':200,277,324,331,339,346,355,366 'max':1186 'maxdimensioninpixel':1185,1201 'maxheight':193 'maxselectioncount':275 'may':463 'mb':1166,1432 'media':11,49,158,307,317,1593,1609 'memori':1157,1416 'messag':687,706 'method':924 'millisecond':1519 'minim':785 'mistak':114,117,1306 'mode':1254 'model':771,1539,1588 'modern':39 'multi':155,227,1337 'multi-select':154,226,1336 'multiphotopick':231 'nativ':132 'need':560,1356 'never':675 'newitem':205,213,282,289 'nil':456,1209,1220 'notdetermin':594,644,903 'note':66 'nscamerausagedescript':617,737 'nsmicrophoneusagedescript':741 'nsphotolibraryaddusagedescript':523,731 'nsphotolibraryusagedescript':534,725 'observ':770,794,1538 'omit':747 'onchang':202,279 'ondisappear':1051,1057,1465,1577 'open':709 'openurl':690,693,717 'option':1191,1215 'origin':1256,1265,1270,1289 'out-of-process':139,543,1331 'output':858 'overlay':1038 'overrid':941,986 'own':1586 'pad':1044 'pass':1238 'pattern':40,57,79,784,1608 'permiss':50,92,96,147,473,538,556,578,615,665,757,1343,1368,1578 'permissiondeniedview':684 'phase':1081,1084 'phauthorizationstatus':585 'photo':6,30,42,145,197,272,334,474,485,505,517,572,576,581,727,826,857,1026,1099,1145,1161,1232,1268,1291,1312,1350,1361 'photo/video':1616 'photokit':1,17,38 'photooutput':804,861,865 'photos/videos':733 'photospick':24,81,86,125,129,195,270,321,328,336,343,352,363,535,1316,1329,1364,1542 'photospicker-swiftui-io':85 'photospickeritem':175,237,377,1243,1441 'photosui':167 'phphotolibrary.authorizationstatus':588 'phphotolibrary.requestauthorization':597 'phpickerfilt':312 'phpickerviewcontrol':25,1319 'pick':7,43,436,1313,1360,1387 'pick-and-us':1386 'picked.image':443 'pickedimag':393,421 'pickedimage.self':441 'picker':72,495,1397,1597,1607 'plus':532 'pointsiz':1178 'pointsize.height':1188 'pointsize.width':1187 'posit':837 'present':490 'preview':778,933 'previewlay':993 'previewview':961,964,974,984 'privaci':90,94,471,1400,1548 'privacy-and-permiss':93 'privat':172,177,234,239,691,802,806,891,1009 'process':142,546,1334 'product':1123 'progressview':1087 'prompt':677 'provid':479 'qr':1618 'queue':919,1506 'raw':1240 'read':522,525,530,562,726 'read-writ':524 'readwrit':500,590,599,1371 'recip':73 'record':742 'red':1287 'redraw':1121 'refer':123,124,1604 'references/av-playback.md':1625,1626 'references/camera-capture.md':75,76,780,781,1028,1613,1614 'references/image-loading-caching.md':1620,1621 'references/photokit-patterns.md':68,69,1605,1606 'remot':1075 'render':1253 'renderingmod':1269,1284 'repeat':676 'replac':134 'represent':773 'request':499,554,575,622,1348,1370 'requestcameraaccess':633,821,893 'requestphotolibraryaccess':583 'requir':143,536,719,724,749,1340,1366 'resiz':190,259,945,1093 'resizeaspectfil':968 'resolut':1144,1413 'respect':1398 'restrict':315,607,656,1485 'result':1598 'return':420,457,595,603,608,612,645,652,657,661,823,840,853,863,872,884,904,909,969,1219,1221 'review':3,118,121,1540 'review-checklist':120 'roundedrectangl':267,1111 'run':138,542,1059,1330 'runtim':753 'save':571,732 'scale':1180,1189 'scaledtofil':260,1094 'scaledtofit':191 'scan':1619 'screenshot':341,347,362,371 'scrollview':248 'secondari':1101 'see':67,779,1027 'select':156,162,196,198,228,271,273,316,322,329,337,344,353,364,373,464,552,1231,1338,1406 'selectedimag':179,188,189,222,241,257,285,442 'selectedimages.append':303 'selectedimages.indices':252 'selecteditem':174,199,204,236,274,281 'self':254 'sendabl':1600 'separ':1537 'serial':1505 'session':28,628,766,800,874,886,955,966,979,981,1021,1061,1534,1570 'session.addinput':854 'session.addoutput':864 'session.beginconfiguration':824 'session.canaddinput':850 'session.canaddoutput':860 'session.commitconfiguration':866 'session.isrunning':870,882 'session.sessionpreset':825 'session.startrunning':876,1489 'session.stoprunning':888,1463 'set':674,710,1582 'share':507 'silent':681 'singl':152,161 'singlephotopick':169 'size':1153 'skill' 'skill-photokit' 'sound':746 'sourc':1204,1213 'source-dpearson2699' 'spike':1158 'start':868,912,1571 'startrun':921,1508 'state':171,176,233,238,1008,1556 'static':401 'status':587,592,604,609,613,637,642,897,902,910 'still':1402 'stop':880,914,1055,1455,1575 'stoprun':923 'stream':1628 'string':688,715 'stroke':1040 'struct':168,230,392,683,951,1005 'success':1089 'support':151,1335 'swift':55,163,229,318,391,579,629,682,788,946,1004,1077,1168,1255 'swiftui':82,87,126,133,165,935,948,1317 'switch':591,641,1083 'synchron':926,1511 'system':488,1375,1392 'systemimag':702 'systemnam':1098,1282 'take':1516 'target':51 'task':207,284,448,1047,1450 'task.detached':873,885,1501 'templat':1271,1285,1295 'text':705 'thread':454,931,1439,1493,1499,1574 'throw':418 'thrown':459 'thumbnail':1237,1418 'tint':1303 'topic-accessibility' 'topic-agent-skills' 'topic-ai-coding' 'topic-apple' 'topic-claude-code' 'topic-codex-skills' 'topic-cursor-skills' 'topic-ios' 'topic-ios-development' 'topic-liquid-glass' 'topic-localization' 'topic-mapkit' 'transfer':376,386,394 'transfererror':429 'transfererror.importfailed':419 'transferrepresent':403,405 'treat':1272 'tri':211,293,437,846 'true':653,878,1195,1197,1199 'two':480 'type':159,215,296,308,383,387,440,1447,1595 'uiapplication.opensettingsurlstring':716 'uiimag':218,219,224,225,299,300,305,306,413,414,426,427,1183,1222,1251 'uiimagepickercontrol':136,1310,1322,1547 'uikit':1172,1320 'uitraitcollection.current.displayscale':1182 'uiview':973,985 'uiview.previewlayer.session':978,980 'uiviewrepresent':940,953,1530,1592 'uncompress':1167,1433 'unknown':610,659,1102 'unless':65 'unnecessari':1383 'updateuiview':972 'url':713,714,718,1079 'urlcach':1135 'usag':433 'use':16,20,998,1128,1225,1288,1294,1309,1315,1363,1389,1420,1444,1543 'user':462,502,668,1230,1358,1399 'user-select':1229 'var':173,178,181,235,240,243,402,692,694,807,810,813,988,992,1010,1013 'vi':37 'via':381 'video':326,332,350,359,640,649,744,836,900,908,1481 'view':170,184,232,246,685,697,774,963,970,1003,1007,1016,1120,1459 'view.previewlayer.session':965 'view.previewlayer.videogravity':967 'vstack':185,247 'whenev':1227 'white':1032 'width':262,1034,1106 'without':521,1475 'work':22 'workflow':1390 'would':759 'wrap':936 'write':516,526,533 'zstack':1017","prices":[{"id":"e6214d6a-5ad6-4d14-8cbe-d489cfe33bdc","listingId":"d3196396-caa5-4e23-9eee-448d834d7fcc","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"dpearson2699","category":"swift-ios-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:01:11.815Z"}],"sources":[{"listingId":"d3196396-caa5-4e23-9eee-448d834d7fcc","source":"github","sourceId":"dpearson2699/swift-ios-skills/photokit","sourceUrl":"https://github.com/dpearson2699/swift-ios-skills/tree/main/skills/photokit","isPrimary":false,"firstSeenAt":"2026-04-18T22:01:11.815Z","lastSeenAt":"2026-04-22T00:53:44.194Z"}],"details":{"listingId":"d3196396-caa5-4e23-9eee-448d834d7fcc","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"dpearson2699","slug":"photokit","github":{"repo":"dpearson2699/swift-ios-skills","stars":468,"topics":["accessibility","agent-skills","ai-coding","apple","claude-code","codex-skills","cursor-skills","ios","ios-development","liquid-glass","localization","mapkit","networking","storekit","swift","swift-concurrency","swiftdata","swiftui","widgetkit","xcode"],"license":"other","html_url":"https://github.com/dpearson2699/swift-ios-skills","pushed_at":"2026-04-21T19:26:16Z","description":"Agent Skills for iOS 26+, Swift 6.3, SwiftUI, and modern Apple frameworks","skill_md_sha":"1453da39bddb7b5cda4d1b69c2952e22b31bb3ad","skill_md_path":"skills/photokit/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/dpearson2699/swift-ios-skills/tree/main/skills/photokit"},"layout":"multi","source":"github","category":"swift-ios-skills","frontmatter":{"name":"photokit","description":"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."},"skills_sh_url":"https://skills.sh/dpearson2699/swift-ios-skills/photokit"},"updatedAt":"2026-04-22T00:53:44.194Z"}}