Contents

read(from:)

Reads the document data in a file at a specified location in the application sandbox.

Declaration

func read(from url: URL) throws

Parameters

  • url:

    A file URL that identifies the location of the document file in the application sandbox. This file URL is typically the one returned by the Fileurl property.

Discussion

Typical UIDocument subclasses shouldn’t need to call this method directly, especially if the entire file is read at once. The default implementation calls load(fromContents:ofType:) on the queue on which open(completionHandler:) was called to provide the UIDocument subclass with the document data object.

Subclasses that want more control over the reading of the document file—for example, that want to read a large document file incrementally—can override this method. It isn’t necessary for these subclasses to call the superclass implementation (super).

See Also

Reading document data