Instance Property

integral

Returns the smallest rectangle that results from converting the source rectangle values to integers.

Declaration

var integral: CGRect { get }

Parameters

rect

The source rectangle.

Return Value

A rectangle with the smallest integer values for its origin and size that contains the source rectangle. That is, given a rectangle with fractional origin or size values, integral rounds the rectangle’s origin downward and its size upward to the nearest whole integers, such that the result contains the original rectangle. Returns a null rectangle if rect is a null rectangle.

See Also

Creating Derived Rectangles

var standardized: CGRect

Returns a rectangle with a positive width and height.

func applying(CGAffineTransform) -> CGRect

Applies an affine transform to a rectangle.

func insetBy(dx: CGFloat, dy: CGFloat) -> CGRect

Returns a rectangle that is smaller or larger than the source rectangle, with the same center point.

func offsetBy(dx: CGFloat, dy: CGFloat) -> CGRect

Returns a rectangle with an origin that is offset from that of the source rectangle.

func union(CGRect) -> CGRect

Returns the smallest rectangle that contains the two source rectangles.

func intersection(CGRect) -> CGRect

Returns the intersection of two rectangles.

enum CGRectEdge

Coordinates that establish the edges of a rectangle.