Draws the attributed string in the specified bounding rectangle using the provided options.
- iOS 7.0+
- macOS 10.11+
- tvOS 9.0+
- watchOS 2.0+
The bounding rectangle in which to draw the string.
Additional drawing options to apply to the string during rendering. For a list of possible values, see
The text attributes with which to draw the string. These are the same attributes that can be applied to an
NSAttributedobject, but in the case of
NSStringobjects, the attributes apply to the entire string, rather than ranges within the string.
A context object with information about how to adjust the font tracking and scaling information. On return, the specified object contains information about the actual values used to render the string. This parameter may be
This method draws as much of the string as it can inside the specified rectangle, wrapping the string text as needed to make it fit. If the string is too big to fit completely inside the rectangle, the method scales the font or adjusts the letter spacing to make the string fit within the given bounds.
If newline characters are present in the string, those characters are honored and cause subsequent text to be placed on the next line underneath the starting point. To correctly draw and size multi-line text, pass
uses in the options parameter.
This method uses the baseline origin by default.
uses is not specified, the rectangle’s height will be ignored and the operation considered to be single-line rendering.