Instance Method

drawTextInRect:

Draws the label’s text (or its shadow) in the specified rectangle.

Declaration

- (void)drawTextInRect:(CGRect)rect;

Parameters

rect

The rectangle in which to draw the text.

Discussion

Don’t call this method directly. Override this method if you want to modify the default drawing behavior for the label’s text.

By the time the system calls this method, the current graphics context is already configured with the default environment and text color for drawing. In your overridden method, you can configure the current context further and then invoke super to do the actual drawing, or you can do the drawing yourself. If you do render the text yourself, don’t invoke super.

See Also

Drawing and Positioning Overrides

- textRectForBounds:limitedToNumberOfLines:

Returns the drawing rectangle for the label’s text.