Questions tagged [uidocumentpickerviewcontroller]
177 questions
3
votes
0 answers
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 code I have so far is as follows,
import…

ThE uSeFuL
- 1,456
- 1
- 16
- 29
3
votes
1 answer
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 file type. My app specifically wants to take a…

CodeBender
- 35,668
- 12
- 125
- 132
3
votes
0 answers
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 wrong with ios10

Venkat Reddy
- 111
- 1
- 8
2
votes
1 answer
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: Error Domain=_UIViewServiceErrorDomain Code=1…

NewToSwiftUI
- 33
- 4
2
votes
0 answers
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 documentPickerController.directoryURL = url
This…

joemiddletone
- 31
- 1
- 2
2
votes
0 answers
In swift, how to paste a .json file in the UIDocumentPickerViewController manually?
I need to past a json file in the UIDocumentPickerViewController, like this:
enter image description here
Here is my code:
import UIKit
import UniformTypeIdentifiers
class ViewController: UIViewController, UIDocumentPickerDelegate {
var…

Christine
- 31
- 6
2
votes
1 answer
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 PDF files and open them.
My problem: I want to access a PDF…

Denis
- 31
- 1
- 3
2
votes
0 answers
Importing the selected file from DocumentPicker into the application [SwiftUI]
I want to take the path of the folder or file I selected from Document Picker and move it to the "Folder" of my own application with FileManager. However, I am getting this error.
I want to save an image that I choose to the "Folder" path of my own…

Ufuk Köşker
- 1,288
- 8
- 29
2
votes
2 answers
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 and print them onto the View. The way it works is…

user3220141
- 59
- 7
2
votes
1 answer
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/system_declared_uniform_type_identifiers
but I can't…

Juliette Destang
- 35
- 1
- 5
2
votes
1 answer
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 'forOpeningContentTypes:', expected 'forExporting:')
Any advice on…

Greg
- 34,042
- 79
- 253
- 454
2
votes
0 answers
Accessing a URL in Google Drive through UIDocumentPickerViewController
I'm using a UIDocumentPickerViewController to allow the user to open a video file stored in cloud storage providers. In the UIDocumentPickerDelegate -> documentPicker(_ :, didPickDocumentsAt:) I check the URL is valid and simply set let video =…

Yariv Adam
- 844
- 9
- 24
2
votes
0 answers
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), even though there are files in the simulator. How can I…

SwiftlyCoding314
- 51
- 2
2
votes
0 answers
What is happening in the App launching sequence of SwiftUI Document Based App?: File picker dialog shown automatically
I'm creating test Document based app with Xcode 11 and SwiftUI.
At first, I have thought that I have to add file picker dialog and open menu/button to my app. But it need not. The file picker dialog was shown automatically when the app…

shuna
- 307
- 1
- 7
2
votes
1 answer
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(forOpeningContentTypes: supportedTypes, asCopy:…

Kavya Vj Jeergi
- 21
- 1