The URL directory obtained by UIDocumentPickerVieweController can be read and written in the directory after calling startAccessingDecurityScopeResource. However, after restarting the app, if the URL saved in the package is called startAccessingDecurityScopeResource again and returns NO, UIDocumentPickerVieweController must be called again to retrieve the URL, and then startAccessingDecurityScopeResource must be called again before continuing the operation. This is too troublesome. Is there a way to continue reading and writing operations in the URL directory after restarting the app?
How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here
The URL authorization read and write obtained by UIDocumentPickerViewController
Is there a way to continue reading and writing operations in the URL directory after restarting the app?
Yes, this is what bookmarks are for. They'll both allow you to preserve access to a file you previously had access to, they'll also track that file across a certain degree of change* (moves, renames, etc.) and (on macOS) mount remote volumes.
*Note issues on iOS mean that bookmarks are not working correctly across volume unmount/mount. For more detail, see this forum post.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware