The UIViewController presenting the UIDocumentPickerViewController gets triggered its viewWillAppear and viewDidAppear functions before the UIDocumentPickerDelegate is called with any of the outcomes. How do you present a different landing depending on the choice?
Asked
Active
Viewed 104 times
1 Answers
0
If I understand you correct, you want to select a document and then immediately jump to another screen depending on what document the user has chosen.
Assuming this, you could just conform to UIDocumentPickerDelegate (which I assume you do to receive the selected fileurls), check for the type of file, and then just present another ViewController or add a childViewController and show it's view as subview.
Happy coding!

Tomte
- 1,331
- 12
- 19
-
Because the delegate is called after the presenter view didappear, I can't prevent the presenter to show the old content before showing new one, if you see what I mean. – Nuthinking Jan 18 '19 at 15:56
-
I see, so you could just have something like an activity indicator running when the picker comes up and let it run until it disappears. I saw that on a couple of other apps. – Tomte Jan 21 '19 at 07:44