Function

CGRectGetWidth

Returns the width of a rectangle.

Declaration

CGFloat CGRectGetWidth(CGRect rect);

Parameters

rect

The rectangle to examine.

Return Value

The width of the specified rectangle.

Discussion

Regardless of whether the width is stored in the CGRect data structure as a positive or negative number, this function returns the width as if the rectangle were standardized. That is, the result is never a negative number.

See Also

Getting Height and Width

CGRectGetHeight

Returns the height of a rectangle.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software