Returns a document object initialized with its file-system location.
- iOS 5.0+
A file URL identifying the location in the application sandbox where document data is to be written. Passing in
nilor an empty URL results in the throwing of an
UIDocument object or
nil if the object could not be created.
After you create a document object and no file exists for it yet, you should next call the
save(to: to write the document to its file-system location in the application sandbox. If
url locates an existing document file, call
open(completion after creating the document object. The second parameter of this method, the save operation constant, should be
for when there is no document file yet. In the completion handler, if you want the document to be automatically synced with other devices you should ensure that its URL is based in a ubiquitous container; see Designing for Documents in iCloud for more information.