I tried to use following code:
struct FilePickerView: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIDocumentPickerViewController {
let documentPicker = UIDocumentPickerViewController(documentTypes: [(kUTTypeImage as String)], in: .open)
return documentPicker
}
func updateUIViewController(_ uiViewController: UIDocumentPickerViewController, context: Context) {
// TODO
}
}
And present it like this:
.sheet(isPresented: $showFilePicker) {
FilePickerView()
}
But on macOS I see blank screen centered in my app window. I solution working on Catalyst.