import SwiftUI
// MARK: - ImagePickerApp
@main struct ImagePickerApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
// MARK: - ContentView
struct ContentView: View {
@State var showPicker = false
var body: some View {
Button { showPicker = true } label: {
Image(systemName: "camera.circle.fill")
.resizable()
}
.frame(width: 100, height: 100, alignment: .center)
.sheet(isPresented: $showPicker) {
ImagePicker()
}
}
}
// MARK: - ImagePicker
struct ImagePicker: UIViewControllerRepresentable {
class Coordinator: NSObject {}
func makeCoordinator() -> Coordinator { Coordinator() }
func makeUIViewController(context _: Context) -> UIImagePickerController { UIImagePickerController() }
func updateUIViewController(_: UIImagePickerController, context _: Context) {}
}
This is a minimal repro case for a SwiftUI app that exhibits what I think is a system bug.
Is there any solution?