Instance Method

contentRect(forBounds:)

Returns the rectangle in which the receiver draws its entire content.

Declaration

func contentRect(forBounds bounds: CGRect) -> CGRect

Parameters

bounds

The bounding rectangle for the receiver.

Return Value

The rectangle in which the receiver draws its entire content.

Discussion

The content rectangle is the area needed to display the image and title including any padding and adjustments for alignment and other settings.

See Also

Getting Dimensions

func backgroundRect(forBounds: CGRect) -> CGRect

Returns the rectangle in which the receiver draws its background.

func titleRect(forContentRect: CGRect) -> CGRect

Returns the rectangle in which the receiver draws its title.

func imageRect(forContentRect: CGRect) -> CGRect

Returns the rectangle in which the receiver draws its image.