read(fromFileURL:options:documentAttributes:)
Sets the contents of the receiver from the file at the given URL.
Declaration
func read(fromFileURL url: URL, options opts: [AnyHashable : Any] = [:], documentAttributes dict: AutoreleasingUnsafeMutablePointer<NSDictionary?>?) throwsParameters
- url:
The location of the file providing text data.
- opts:
The option keys for importing the document. For a list of possible values, see “Option keys for importing documents” in Nsattributedstring.
- dict:
On return, contains the document attributes. For a list of possible values, see “Document Attributes” in Nsattributedstring.
Discussion
For RTF formatted files, the contents of the file are appended to the previous string instead of replacing the previous string.