Using the simulator, running iOS 13.5, I encountered an intermittent, hard to reproduce issue whereby upon opening a file using UIDocumentPickerViewController
(mode: UIDocumentPickerModeOpen
), I get two documentPicker:didPickDocumentsAtURLs:
calls in a row, a couple of milliseconds apart, containing the same URL.
The document picker itself is presented via a presentViewController
call.
It may also be relevant that the issue occurs in an Application Extension target.
(And yes, for iOS 14+ I do use initForOpeningContentTypes
, but that's outside the scope of this question.)
I wasn't able to find a documented explanation as to under what circumstances could this happen, and I don't want to simply dismiss it as a simulator issue that won't occur on actual devices (especially given that the bug occurs extremely rarely, so simply testing it on the device doesn't yield conclusive evidence of the bug not being present). Has anyone else experienced a similar issue?