-
Hello, I'm trying to wrap some Apple APIs for selecting documents (images from the user's photo library and documents from iCloud) but I'm running into a problem and I don't have a good solution. I'm hoping someone can offer one. The problem is that the APIs' coordinator delegate methods are invoked after the picker view controller is already dismissed so driving their presentation through state doesn't seem possible. If the reducer intercepts the I have a working vanilla SwiftUI solution using @State properties (SwiftUI does the right thing in that it updates those properties when the coordinator delegate methods are executed, even if the presented picker is already dismissed) but then how do I connect those @State properties to TCA? Is it ok to have a property observer attached to those @State properties and fire TCA actions from within them? That doesn't sound right to me. Also, a separate issue is: how to control the dependency on those APIs? It's not clear to me how I should go about that either but, at the moment, that's a lower-priority issue for me. Any help would be much appreciated. Many thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In case someone is looking for the solution for wrapping the It doesn't send a |
Beta Was this translation helpful? Give feedback.
In case someone is looking for the solution for wrapping the
UIDocumentPickerViewController
for TCA and fixing the dismiss action issue - my workaround was to use theUIDocumentBrowserViewController
instead.It doesn't send a
dismiss
action after selecting a document. It allows us to control the dismissal process manually.