Instance Method

drawAtPoint:

Draws the attributed string starting at the specified point in the current graphics context.

Declaration

iOS, Mac Catalyst, tvOS, watchOS
- (void)drawAtPoint:(CGPoint)point;
macOS
- (void)drawAtPoint:(NSPoint)point;

Parameters

point

The point in the current graphics context where you want to start drawing the string. The coordinate system of the graphics context is usually defined by the view in which you are drawing.

Discussion

This method draws the entire string starting at the specified point. This method draws the line using the attributes specified in the attributed string itself. 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.

There must be either a focused view or an active graphics context when you call this method.

See Also

Drawing the String

- drawInRect:

Draws the attributed string inside the specified bounding rectangle in the current graphics context.

- drawWithRect:options:context:

Draws the attributed string in the specified bounding rectangle using the provided options.