'Why are specific files not visible when using UIDocumentPickerViewController in Swift 5.0?
For my iPhone app I am working on a file upload in the background, with progress indicator, function. So I've placed multiple files in my simulator's directory. An 8MB mp3 file, and a 22KB Excel file. In the Finder folder I see both files.
If for supportedTypes I use [UTType.item, UTType.mp3]
all I see is the Excel file, and it's selectable
If for supportedTypes I use [UTType.item]
all I see is the Excel file, and it's selectable
If for supportedTypes I use [UTType.mp3]
all I see is the Excel file, and it is not selectable
So am I missing something? And is there a type for "all" files?
case ButtType.file.rawValue:
let supportedTypes: [UTType] = [UTType.mp3]
let pickerViewController = UIDocumentPickerViewController(forOpeningContentTypes: supportedTypes)
pickerViewController.delegate = self
pickerViewController.allowsMultipleSelection = false
present(pickerViewController, animated: true, completion: nil)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|