Function

CGRectGetMidX

Returns the x- coordinate that establishes the center of a rectangle.

Declaration

CGFloat CGRectGetMidX(CGRect rect);

Parameters

rect

The rectangle to examine.

Return Value

The x-coordinate of the center of the specified rectangle.

See Also

Getting Min, Mid, and Max Values

CGRectGetMinX

Returns the smallest value for the x-coordinate of the rectangle.

CGRectGetMinY

Returns the smallest value for the y-coordinate of the rectangle.

CGRectGetMidY

Returns the y-coordinate that establishes the center of the rectangle.

CGRectGetMaxX

Returns the largest value of the x-coordinate for the rectangle.

CGRectGetMaxY

Returns the largest value for the y-coordinate of the 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