SwiftUI Full-Screen UIImagePickerController (Camera)
问题 I present a UIImagePickerController within my application by presenting it with logic inside of a sheet modifier. In short, the following three types handle displaying and dismissing a instance of UIImagePickerController inside of a UIViewControllerRepresentable type, which works as expected: struct DetailsView: View { enum Sheet: Hashable, Identifiable { case takePhoto var id: Int { hashValue } } @State private var activeSheet: Sheet? var body: some View { Text("Hello, World!") .sheet(item: