Post

Replies

Boosts

Views

Activity

Reply to Custom ViewController height for UIPresentationController
I'm assuming the original asker probably found an answer since this post/question is 3 years old now. However, I was looking for an answer for this very thing myself and was a little bummed at first when I didn't see any answers here. I kept searching and came across two extremely helpful articles. I want to share in case anyone else is looking as well and comes across this question. Daniel Gauthier's Custom Transitions Blog Post: https://danielgauthier.me/2020/03/03/vctransitions3.html The above article mentions this blog post by Kyle Bashour on Custom View Controller Transitions as being a huge help: https://kylebashour.com/posts/custom-view-controller-presentation-tips Good luck and happy coding!
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’21
Reply to allowsMultipleSelection not working via SwiftUI
It may be because you're not setting the delegate? If you need to set the delegate you need to use a coordinator of some sort. This is what I'm using and it's working: struct DocumentPickerView: UIViewControllerRepresentable { var onComplete: ([URL], MimeType) -> Void func makeCoordinator() -> DocPickerCoordinator { DocPickerCoordinator(docParent: self) } func makeUIViewController(context: UIViewControllerRepresentableContext<DocumentPickerView>) -> UIDocumentPickerViewController { let picker = UIDocumentPickerViewController(documentTypes: [.pdfType], in: .import) picker.allowsMultipleSelection = true picker.delegate = context.coordinator return picker } func updateUIViewController(_ uiViewController: UIDocumentPickerViewController, context: UIViewControllerRepresentableContext<DocumentPickerView>) {} } class DocPickerCoordinator: NSObject, UIDocumentPickerDelegate { private var parent: DocumentPickerView init(docParent: DocumentPickerView) { parent = docParent } func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { parent.onComplete(urls, .pdf) } } extension String { static let pdfType = kUTTypePDF as Self } I hope this helps!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’20