Instance Method

boundingRect(with:options:)

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

Declaration

func boundingRect(with size: NSSize, options: NSString.DrawingOptions = []) -> NSRect

Parameters

size

The size of the rectangle to draw in.

options

The string drawing options. See NSString.DrawingOptions for the possible values.

Return Value

The bounding rectangle in the current graphics context.

Discussion

The origin of the rectangle returned from this method is the first glyph origin.

See Also

Deprecated Methods

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

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

Deprecated
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