Skip to content

Instantly share code, notes, and snippets.

@ulian-onua
Created July 26, 2023 09:04
Show Gist options
  • Save ulian-onua/6218936f190cd9832f6024ac05c4e186 to your computer and use it in GitHub Desktop.
Save ulian-onua/6218936f190cd9832f6024ac05c4e186 to your computer and use it in GitHub Desktop.
Test gist
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