UIDocumentPickerViewController in SwiftUI on mac (macCatalyst)
问题 So I've been meddling with "moving" a small SwiftUI iPad app to the Mac, and I've hit a bit of a speed bump with UIDocumentPickerViewController . I have wrapped the UIDocumentPickerViewController in a UIViewControllerRepresentable like so : struct DocumentPickerView: UIViewControllerRepresentable { func makeUIViewController(context: Context) -> UIDocumentPickerViewController { let documentPicker = UIDocumentPickerViewController(documentTypes: [(kUTTypeImage as String)], in: .import) return