Created
July 26, 2023 09:04
-
-
Save ulian-onua/6218936f190cd9832f6024ac05c4e186 to your computer and use it in GitHub Desktop.
Test gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct DocumentPicker: UIViewControllerRepresentable { | |
// MARK: - Environment | |
@Environment(\.dismiss) var dismiss | |
let completion: (_ result: PickerResult) -> Void | |
func makeUIViewController(context: UIViewControllerRepresentableContext<DocumentPicker>) -> UIDocumentPickerViewController { | |
let picker = UIDocumentPickerViewController(forOpeningContentTypes: [.image]) | |
picker.delegate = context.coordinator | |
return picker | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment