177 questions
23
votes
3
answers
7k
views
UIDocumentPickerViewController iOS13 not Working
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 ...
12
votes
2
answers
7k
views
UIDocumentPickerViewController - 'init(documentTypes:in:)' was deprecated in iOS 14.0
Method is deprecated from iOS 14, so need support for both iOS 14 and later. And iOS 13 and earlier.
11
votes
1
answer
7k
views
Reading files from external storage in iOS 13
I have an iOS app that is trying to read files from an external storage device without importing them into the App's sandbox.
I have followed Apple's documentations outlined here to do this --
...
10
votes
3
answers
15k
views
How to get All Extensions for UTType Image, Audio, and Video
Is there a way to get All of the different UTType extension types as Strings? I need them specifically for images, audio, and video.
I followed this answer, but it doesn't give me all of the ...
10
votes
5
answers
6k
views
UIDocumentPickerDelegate method(didPickDocumentsAt) not called by iOS
I have a query regarding delegate method not been getting called for DocumentPickerViewController, here's the background, I just need to import the resource whatever available from my Files App and ...
9
votes
2
answers
3k
views
UIDocumentPickerViewController: how to open a given subdirectory
I am using UIDocumentPickerViewController with the import mode (UIDocumentPickerModeImport) in order to let the user import documents from cloud storage providers (dropbox, etc).
Each time the user ...
9
votes
0
answers
618
views
Pick document and gallery images with same picker
I can pick gallery images with UIImagePickerController and documents with UIDocumentPickerViewController. But my question is, is there any way to pick gallery image and pdf documents with same picker?
...
8
votes
0
answers
312
views
Downloading files in a folder selected by UIDocumentPickerController
I'm trying to download the files contained in a folder hierarchy picked by the UIDocumentPickerController. I use the URL I get from documentPicker:DidPickDocumentsAtURLs: with an NSFileCoordinator.
...
7
votes
3
answers
1k
views
UIDocumentPicker navigation bar buttons are hidden at iOS 11
I notice a problem in my UIDocumentPicker's navigation bar at iOS 11 only, the done, cancel, or edit buttons are invisible, and when the user touch it it appears i.e. The color at normal state is ...
6
votes
1
answer
1k
views
iOS custom UTI/filetype with UIDocumentPickerViewController
I've got a custom filetype that I'm trying to allow my app to open from a UIDocumentPickerViewController. It isn't, however, working. (A similar situation and problem seem to be described here, but ...
6
votes
2
answers
3k
views
UIDocumentPickerViewController - Delegate method not being called
I'm using UIDocumentPickerViewController to select documents from the Files and upload it to a server. I'm able to successfully access Files, but upon clicking on the file the delegate method doesn't ...
5
votes
2
answers
2k
views
UIDocumentPickerViewController not calling didPickDocumentAtURL on Mac Catalyst
I have this code in a UIViewController that confirms to UIDocumentPickerDelegate:
- (void)openTextFilePicker {
NSArray *UTIs = [NSArray arrayWithObjects:@"public.text", nil];
[self ...
5
votes
2
answers
2k
views
Buttons not visible in UIDocumentPickerViewController
I want to import a document into my application. I have created a Demo to import Document. A demo is working. below is the code of the Demo to open UIDocumentPickerViewController.
-(IBAction) ...
5
votes
1
answer
3k
views
How to get file name and file size from UIDocumentPickerViewController in iOS 14?
I have to create feature for upload some document in pdf type and have to show name and file size with file that I selected from UIDocumentPickerViewController 's delegate before upload it.
How can I ...
5
votes
3
answers
4k
views
Swift Document Picker, can not reach the file
I am writing a project which involves picking a file and getting the content of the file. However, I think it is not reaching the correct url of the file.
Here is the function where it calls the ...
4
votes
2
answers
4k
views
(Swift) How can I get a Data representation of the documentPicker URL
I use the didPickDocumentAt function to retrieve the url of the picked file in the DocumentPickerViewController. I have a multipart upload function that uses alamofire to upload files to the backend.
...
4
votes
1
answer
668
views
Unable to pick pages file with UIDocumentPickerViewController
I'm using UIDocumentPickerViewController for picking document. Below are the specified UTIs :
NSArray *types = @[(NSString*)kUTTypeImage,(NSString*)kUTTypeSpreadsheet,(NSString*)kUTTypePresentation,(...
4
votes
1
answer
2k
views
Unable to select file when using UIDocumentPickerViewController initForOpeningContentTypes
I'm trying to use the iOS 14 initForOpeningContentTypes: rather than the deprecated initWithDocumentTypes:inMode: and I'm unable to get access to files with the extension p8 (they are greyed out).
I'm ...
4
votes
1
answer
10k
views
The file couldn't be opened because there is no such file when getting FileAttributesKey - Swift
I am trying to get the FileAttributesKey using FileManager in iOS using Swift. When I try that, I am getting the following error"
Error Domain=NSCocoaErrorDomain Code=260 "The file “Personal%...
4
votes
1
answer
2k
views
Files with imported UTIs are greyed out in UIDocumentPickerViewController
In my iOS app I am opening a UIDocumentPickerViewController to import .sty files (MIDI styles). For this I have declared a custom UTI in Imported UTIs and in Document Types.
The problem is that on my ...
4
votes
2
answers
4k
views
UIDocumentPickerViewController which cloud service is selected by user?
I want to select files from Google drive and One drive cloud services for that purpose I am using UIDocumentPickerViewController
ex:
func didPressOneDriveChoose() {
let importMenu = ...
4
votes
1
answer
2k
views
How to read files of External Mass Storage Devices Without DocumentPicker? (iOS)
Just to give some context, there is an iOS app I'm building (in Xamarin) that requires the ability to fetch files (in an automatic way without having the user to navigate to the files and select them ...
4
votes
0
answers
280
views
How to open the root folder with UIDocumentPickerViewController
I want to show most root folder with UIDocumentPickerViewController on presentation.
UIDocumentPickerViewController has directoryURL feature. But I can't access the URL i want to access.
Example usage ...
4
votes
1
answer
536
views
Unable to select pre-registered files types using UIDocumentPickerViewController with with pre-iOS 14 target
I'm using a document picker to import data into an app. One of the files to import is a .GPX (it's actually an XML file of GPS data, but that's not relevant). I define a custom file type (as it's ...
4
votes
0
answers
2k
views
UIDocumentPickerViewController error after closing
I am using a DocumentPickerViewController to import a document in my app. The picker does it's work, there are no bugs and no crashes but every time after a document is picked or the view controller ...
4
votes
1
answer
2k
views
Alternatives for UIDocumentMenuViewController in iOS 11
Is it possible to implement the look and feel of UIDocumentMenuViewController (deprecated in iOS 11) in iOS 11? The closest I found in iOS 11 is UIDocumentPickerViewController but this doesn't allow ...
3
votes
3
answers
4k
views
How to use UTType with a UIDocumentPicker (pages? docx?)
I'm trying to open a picker with only certain file types allowed.
I'm using this documentation to find the UTType I need:
https://developer.apple.com/documentation/uniformtypeidentifiers/uttype/...
3
votes
1
answer
2k
views
Unable to select a PowerPoint (PPTX) document with UIDocumentPickerViewController
Just to clear up a few quick items first:
I do not want to open and/or preview the document, as I see a common answer referring users to a dependency for doing that
I do not want to select any other ...
3
votes
1
answer
4k
views
Couldn't communicate with a helper application when i pick the zip file from the iCloud using UIDocumentPickerViewController
Whenever i pick the file from the iCloud using UIDocumentPickerviewcontroller from my application but it will show this alert on iPhone simulator.
NSArray *types = @[(NSString*)kUTTypeArchive];
...
3
votes
1
answer
3k
views
Showing a save file document picker in iOS without providing local file urls
I want to show a file picker for choosing a "save to file" location on iOS. The UIDocumentViewPickerController offers the method initWithURL:inMode: (https://developer.apple.com/documentation/uikit/...
3
votes
1
answer
973
views
Alternative UIActivityViewController save dialog for Mac Catalyst or solution for UIDocumentPickerViewController throwing error code 260
I am looking for an alternative export menu other then UIActivityViewController for a Mac Catalyst app. While this works, the user can not choose where they want to save the file (the file is a JSON ...
3
votes
2
answers
2k
views
Importing files in iOS : UIDocumentPicker vs UIDocumentBrowser
As per the documentation, both UIDocumentPickerViewController and UIDocumentBrowserViewController can be used for importing documents outside an apps sandbox.
For selecting & importing a document ...
3
votes
1
answer
421
views
Porting UIDocumentPickerViewController into SwiftUI and I keep getting Error Domain=_UIViewServiceErrorDomain Code=1
Am porting over my UIDocumentPickerViewController into SwiftUI and whether I pick a file or cancel the picker I keep getting the error:
[DocumentManager] The view service did terminate with error: ...
3
votes
0
answers
338
views
Delegate method UIDocumentPickerViewController are not working on simulator
Delegate method are not working for UIDocumentPickerViewController
from upload action want to load document from simulator for uploading to other action...
func uploadFile(){
let ...
3
votes
0
answers
269
views
UIDocumentPickerViewController only showing recents tab
I have been trying to implement a UIDocumentPickerViewController in SwiftUI without much luck. When I present the view in a sheet, all that is there is a blank "recents" tab (as shown below),...
3
votes
1
answer
802
views
Memleak with UIDocumentPickerViewController via SwiftUI
The application is built for iOS. I want user to choose a file from it's directory and get the url of chosen one. Apple recommends UIDocumentPickerViewController to solve this issue. I wrapped it in ...
3
votes
0
answers
59
views
UIDocumentMenuViewController have wrong frame listView
Good day to all. I support the old version of the application written on Objective C . I want to implement a functional - File Browser(File Provider). But using UIDocumentMenuViewController or ...
3
votes
0
answers
575
views
Pick Google docs using UIDocumentPickerViewController
I am building a file picker using UIDocumentPickerViewController and I want to pick the following file types only (others needs to be disabled),
doc
docx
pdf
gdoc (Google doc file format)
txt
rtf
The ...
3
votes
0
answers
90
views
Getting error while picking document throguh uidocumentpickerviewcontroller from onedrive ios
I am trying to choose document from onedrive using uidocumentpickerviewcontroller in my ios App (ios 10.3.3) , i am getting error "selected file not found " , but it's working fine in ios11 . whats ...
2
votes
2
answers
5k
views
How to get correct filename from UIDocumentPicker, didPickDocumentsAt urls: [URL]
I'm trying to get the selected filename with extension from UIDocumentPickerViewController but the filename has "]" at the end of the file extension. Any suggestion on what is the correct way?
Here ...
2
votes
2
answers
2k
views
SwiftUI: Display file url from Array after user Picks file using DocumentPicker
I followed a tutorial on getting Url from a Document a user chooses and be able to display it on the View. My problem now is I want to add those Url's into an array. Then get the items from the array ...
2
votes
1
answer
923
views
how to initalise UIDocumentPickerViewController noting "forOpeningContentTypes" (from doco) seems to be deprecated in IOS?
When following the onsite IOS documentation for UIDocumentPickerViewController in Xcode 12.5.1 with IOS 14.5 deployment target I get an error:
Incorrect argument label in call (have '...
2
votes
1
answer
979
views
UIDocumentPickerController does not occupy entire screen in IOS14
I am using following code to import files,
if #available(iOS 14, *) {
let supportedTypes: [UTType] = [UTType.text, UTType.data]
let documentPicker = UIDocumentPickerViewController(...
2
votes
2
answers
1k
views
Directly access file from External drive without UIDocumentPickerViewController
According to this:
https://developer.apple.com/documentation/uikit/view_controllers/providing_access_to_directories
iOS 13 adds the ability of UIDocumentPickerViewController to select a directory, ...
2
votes
1
answer
661
views
UIDocumentPickerViewController: Open folder from Dropbox
How can I use UIDocumentPickerViewController to let the user select a folder from their Dropbox?
If I call this, I can browse for folders, but the Dropbox folder is greyed out:
[[...
2
votes
1
answer
346
views
How to display sandboxed files using a UIDocumentPickerViewController?
I am trying to display documents created by my app using the UIDocumentPickerViewController. Is this possible, or do I need to roll my own? Based on my research, it appears that this can't be done, ...
2
votes
1
answer
293
views
Enumerating an iCloud Drive directory
I'd like to enumerate the files in a directory chosen by the user within a UIDocumentPickerViewController.
I get the directory URL returned from the document picker.
I call ...
2
votes
1
answer
3k
views
Document Picker View Controller issue in Swift
I have a button in my view controller, when click a button it open a document picker view controller, i have set type like KUTypePDF and KUTypeZipArchive , when i select any of these item from google ...
2
votes
1
answer
1k
views
UIDocumentPickerViewController - open Folder by directoryURL
In short: I am currently working on an app with which you can scan a QR code. The QR code contains a path to a folder in Apple's own "Files" app. And in this folder I would like to view the ...
2
votes
1
answer
2k
views
documentPicker delegate not called by UIDocumentPickerViewController
I have the following ViewController that implements functionality for importing files into the app using the UIDocumentPickerViewController:
class MyViewController: UIViewController {
override ...