Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implements photo picking, camera capture, image loading, video recording, and media permissions in iOS apps using PhotoKit and AVFoundation.
Use this skill ↓86% 86%0 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 19 of 22 without it.
3 of 3 safety checks passed
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.
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.
import SwiftUI
import PhotosUI
struct SinglePhotoPicker: View {
@State private var selectedItem: PhotosPickerItem?
@State private var selectedImage: Image?
var body: some View {
VStack {
if let selectedImage {
selectedImage
.resizable()
.scaledToFit()
.frame(maxHeight: 300)
}
PhotosPicker("Select Photo", selection: $selectedItem, matching: .images)
}
.onChange(of: selectedItem) { _, newItem in
Next to this one in the catalogue, plus more from the same author.