I have this function
func showFilePicker() { let allowedExtensions = ["custom"]
let documentPicker = UIDocumentPickerViewController(documentTypes: allowedExtensions, in: .import)
documentPicker.delegate = self
documentPicker.allowsMultipleSelection = false
documentPicker.directoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first
present(documentPicker, animated: true, completion: nil)
}
I have these keys in the app pList
<key>UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
The object is to display a list of files that exist ONLY in the /DOCUMENT directory belonging to the app (this is iOS), and provide no access to any other files on the device.
For testing I have manually inserted a file into the /DOCUMENT directory on the simulator
When I call this routine. It DOES show me the file, but it cannot be selected (gray)
also, navigation to other “public” directories is still active
Also it say that the first line was deprecated in ios14, but I can find no replacement syntax anywhere
I guess I could create my own custom view, but I hate to reinvent the wheel like this