Initializer

init(path:documentAttributes:)

Initializes a new attribute string object from RTF or RTFD data contained in the file at the given path.

Declaration

init?(path: String, documentAttributes dict: AutoreleasingUnsafeMutablePointer<NSDictionary?>?)

Parameters

path

The path to an RTF or RTFD file.

docAttributes

An in-out dictionary containing document-level attributes described in Document Attributes. May be NULL, in which case no document attributes are returned.

Return Value

Returns an initialized object, or nil if the data can’t be decoded.

Discussion

The contents of path will be examined to best load the file in whatever format it’s in. Filter services can be used to convert the file into a format recognized by Cocoa. Also returns by reference in docAttributes a dictionary containing document-level attributes described in Document Attributes. docAttributes may be NULL, in which case no document attributes are returned. Returns an initialized object, or nil if the file at path can’t be decoded.

See Also

Deprecated Methods

init?(url: URL, documentAttributes: AutoreleasingUnsafeMutablePointer<NSDictionary?>?)

Initializes a new attributed string object from the data at the given URL.

Deprecated
init(fileURL: URL, options: [AnyHashable : Any], documentAttributes: AutoreleasingUnsafeMutablePointer<NSDictionary?>?)

Initializes a new attributed string object from the data at the given URL.

Deprecated
var containsAttachments: Bool

Returns whether the attribute string contains any attachment attributes.

Deprecated
func url(at: Int, effectiveRange: NSRangePointer) -> URL?

Returns a URL, either from a link attribute or from text at the given location that appears to be a URL string, for use in automatic link detection.

Deprecated
func draw(with: NSRect, options: NSString.DrawingOptions)

Draws the receiver with the specified options, within the given rectangle in the current graphics context.

Deprecated
func boundingRect(with: NSSize, options: NSString.DrawingOptions) -> NSRect

Calculates and returns bounding rectangle for the receiver drawn using the options specified, within the given rectangle in the current graphics context.

Deprecated