0

I'm saving a file using UIDocumentPickerViewController, by having it move and rename a file from a temp location:

UIDocumentPickerViewController* documentPicker = [[UIDocumentPickerViewController alloc] initForExportingURLs:@[theTempFileURL]  asCopy:YES];
[self presentViewController:documentPicker animated:true completion:nil];

As part of this process, the user can choose a new name for the file. How can I get the file name the user chose for the save?

1 Answers1

0

Figured it out. I'd forgotten to set the delegate for the UIDocumentPickerViewController. In the didPickDocumentsAtURLs delegate, I can check the mode of the controller. If I'm in UIDocumentPickerModeExportToService mode, then the list of URLs passed to the delegate method is a list of where files were saved.