I have a WKWebView
in a view controller. When an user clicks on "Upload File" button (which is on the webpage shown), UIDocumentPickerViewController
pops up. This is expected and totally neccessary but:
Whenever the user clicks on any button ("Upload Photo or Video", "Cancel"), the UIDocumentPickerViewController
dismisses itself AND the parent view controller that it's in.
I have added a symbolic breakpoint for [UIViewController dismissViewControllerAnimated:completion:]
and indeed saw that -dismissViewController...
is called twice. After the first time it dismisses UIDocumentPickerViewController
, after the second one – my parent view controller.
By the way, on the iPad there is no problem, probably because UIDocumentPickerViewController
is presented as a popover.
Why is this happening and what should I do?
Thanks!