23

On my application, i use UIDocumentPickerViewController to allow the user to pick files (import), but starting from iOS 13 that functionality stop working, basically the document picker is open, but the user can't choose a file (taping the file does nothing).

I made a simple sample just to isolate the code:

class ViewController: UIViewController, UIDocumentPickerDelegate {

    @IBAction func openDocumentPicker(_ sender: Any) {
        let types = [String(kUTTypePDF)]
        let documentPickerViewController = UIDocumentPickerViewController(documentTypes: types, in: .import)
        documentPickerViewController.delegate = self
        present(documentPickerViewController, animated: true, completion: nil)
    }

    func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
        print("Cancelled")
    }

    func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
        print("didPickDocuments at \(urls)")
    }

}

Sample project: https://github.com/Abreu0101/document-picker-iOS13-issue

Reference: enter image description here

bauerMusic
  • 5,470
  • 5
  • 38
  • 53
  • Which version of Xcode and iOS 13 are you using? Also make sure you test this on a real iOS device. – rmaddy Sep 10 '19 at 01:09
  • @rmaddy to make the sample project iOS 11 beta 6 (but for my app, im using Xcode 10.2). It's happening both on Simulator and real Device (iPhone 7 iOS 13.1) – José Roberto Abreu Sep 10 '19 at 01:15
  • I'm experiencing a very similar issue, although the failure doesn't happen every time. Usually `documentPicker(_, didPickDocumentAt)` gets called the first time after a fresh launch of my app, but fails on all subsequent attempts. This happens both in the Recents and Browse tab, with iCloud Drive and Dropbox. I'm running on a physical iPhone X with iOS 13.1 beta 3, building with Xcode 11.0 GM. – Jamie A Sep 17 '19 at 18:15
  • 1
    @JamieA Looks like is a bug on iOS 13 beta. After upgrading to official iOS 13 start working. Btw notice that this wasn't specific of my App, was also happening in other apps (i.e Slack). – José Roberto Abreu Sep 24 '19 at 17:15
  • any fixes for this? i am facing this issue – Pulkit Sharma Oct 18 '19 at 05:37
  • 1
    Same issue for our application, but not for all devices. Waiting for solution. Thanks in advance. – Pradip Oct 23 '19 at 05:45
  • Does anybody know if this is fixed in iOS 13.2? – andygeers Nov 08 '19 at 10:19
  • Same issue with iPadOS 13.2.3. Prior versions didn't work only on simulators, now it doesn't work on an actual device. – John F Donigan Nov 29 '19 at 18:12
  • 1
    I downloaded the "Particles" app demo package from Apple, and it acts the same way. – John F Donigan Nov 29 '19 at 18:19
  • Same issue still exist. Nothing seems to work to fix it. But if I open document in our app from apples archive app it works fine and the file that was opened this way is unlocked and can now we opened through documentpicker again. This is quite frankly VERY frustrating. – Warpzit Oct 26 '21 at 11:39

3 Answers3

2

When I got this issue, I realised that it's working when choosing files from "Browse" tab because I implemented the method "didPickDocumentAt", but it was not working when I tapped on files from "Recent" tab.

To make it work on "Recent" tab, I'd to implement the method "didPickDocumentsAt", which makes the same thing, but it handles an array of URLs.

Allan
  • 308
  • 2
  • 7
2

On Mojave there's the problem, make sure you upgrade your os to Catalina.

saad agoujil
  • 101
  • 1
  • 7
0

I enountered this issue on iOS 13.2.2. Updated to iOS 13.2.3 fixed this issue without any code changes.

Bill Chan
  • 3,199
  • 36
  • 32
  • 1
    I take that you meant to say that updating to iOS 13.2.3 fixed the issue? As of today (6 December 2019), I don't believe that a version 13.3.3 has been released yet. – Phlippie Bosman Dec 06 '19 at 14:34