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 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.