Questions tagged [uidocumentpickervc]

97 questions
6
votes
1 answer

how to find the size of a document in iCloud before picking it and downloading to device using UIDocumentPickerViewController

how to find the size of a document in iCloud before picking it and downloading to device using UIDocumentPickerViewController.I can download the document to the device and then converting to NSData,i can determine the file size,but can we avoid…
sujith1406
  • 2,822
  • 6
  • 40
  • 60
6
votes
1 answer

UIDocumentPickerViewController -> "No Documents" because iCloud not available

I use this method to show an UIDocumentPicker: func showDocumentPicker(){ let docPicker = UIDocumentPickerViewController(documentTypes: ["public.composite-content "], inMode: UIDocumentPickerMode.Import) docPicker.delegate = self …
gutenmorgenuhu
  • 2,312
  • 1
  • 19
  • 33
6
votes
1 answer

Download files from UIDocumentPicker and wait until download has finished

I'm trying to download a file from the -documentPicker:didPickDocumentAtURL: method. I've tried to get the data of the file using NSData *data = [NSData dataWithContentsOfURL:url]; but it didn't work how I expected, because the UIDocumentPicker…
FTFT1234
  • 435
  • 8
  • 17
5
votes
1 answer

How to use UIDocumentPickerViewController to pick a custom type?

I'm having a problem importing a file from the cloud. I'm dealing with a custom filetype that I didn't actually create. So I don't know what the actual extension type is (for example com.example.pdf). The file ends in .toc, so is there a way I can…
Logan
  • 1,047
  • 10
  • 33
5
votes
3 answers

Doc file issues with UIDocumentPickerController in iOS swift?

I am using below code for showing the document picker.When i show the picker i use below code let documentPickerController = UIDocumentPickerViewController(documentTypes: [String(kUTTypeText), String(kUTTypePDF), String(kUTTypePNG),…
TechChain
  • 8,404
  • 29
  • 103
  • 228
5
votes
1 answer

startAccessingSecurityScopedResource() return always false

When I try to import a file to my server from iCloud Drive or Dropbox, startAccessingSecurityScopedResource() return false only device but return true when I testing in simulator (Xcode 8, Swift 2.3, minimum target 8.0). This is my code: { …
Zept
  • 1,158
  • 1
  • 10
  • 14
5
votes
1 answer

UIDocumentPickerViewController doesn't call the didPickDocument method

I have a document picker, but after selecting a document, the didPickDocumentAt part is never triggered. It was working before I updated swift, is there something that is different now? func selectDocument(_ sender: UIButton!){ let…
John
  • 1,808
  • 7
  • 28
  • 57
5
votes
2 answers

navigationBar .tintColor with UIDocumentPickerViewController (Document Picker)?

I am using Swift 2 in Xcode 7.0 beta 6 Long story short, I am trying to work out how to set .navigationBar.barStyle and navigationBar.tintColor when using a document picker to access iCloud - i.e. a UIDocumentPickerViewController. I have tried…
simons
  • 2,374
  • 2
  • 18
  • 20
4
votes
0 answers

UIDocumentPickerViewController never calls didPickDocument method

My document picker opens properly and I can see all my files (google drive), but when I select one, nothing happens. The view dismisses back and thats it. Am I missing something? This was working before updated Xcode and Swift. func…
John
  • 1,808
  • 7
  • 28
  • 57
4
votes
1 answer

How to allow only doc and pdf type in UIDocumentMenuViewController iOS?

I tried to load some files from Dropbox/G-Drive/iCloud using the UIDocumentMenuViewController. I tried, UIDocumentMenuViewController *importMenu = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[(__bridge NSString*)kUTTypeContent]…
codebot
  • 2,540
  • 3
  • 38
  • 89
4
votes
0 answers

UIDocumentPickerViewController vs iCloud Drive app container?

The app's container is public, so it is visible in iCloud Drive. The app displays files in its public iCloud container. The app can I also present the UIDocumentPickerViewController with UIDocumentPickerModeImport mode so users can import files…
Karmeye
  • 1,399
  • 1
  • 8
  • 16
3
votes
1 answer

Error while closing the UIDocumentPicker

I am trying to initiate DocumentPicker in my app. I have declared: var documentPicker: UIDocumentPickerViewController = UIDocumentPickerViewController(documentTypes: ["public.text"], in: UIDocumentPickerMode.open) …
misi06
  • 259
  • 1
  • 8
  • 16
3
votes
1 answer

How do I enable multiple files selection while picking file using UIDocumentPickerViewController?

I'm trying to pick file from Files App using UIDocumentPickerViewController but I can't see Select button for multiple selection in picker. Why this is happening? am i doing anything wrong? Can anyone help? Code snippet : NSArray *arrContents =…
Dev
  • 41
  • 5
3
votes
4 answers

UIDocumentPickerViewController dismisses parent view controller

I have a WKWebView in a view controller. When an user clicks on "Upload File" button (which is on the webpage shown), UIDocumentPickerViewController pops up. This is expected and totally neccessary but: Whenever the user clicks on any button…
Kansway
  • 160
  • 2
  • 9
3
votes
0 answers

How to find the provider/extension used to pick a file in UIDocumentPickerViewController?

I'm trying to find a way to know which app the user has selected when importing/opening a file in the picker. documentPicker:didPickDocumentAtURL: gives a UIDocumentPickerViewController object back. I looked in it but no object has the information…
Geva
  • 820
  • 6
  • 14