CGRect
struct CGRect
-
Mechanica
Returns a
CGRectvalue initialized with an origin at (0,0) and the provided width and height.Declaration
Swift
public init(width: CGFloat, height: CGFloat)Parameters
widthThe width.
heightThe height.
-
Mechanica
The center point.
Declaration
Swift
public var center: CGPoint { get set } -
Mechanica
Returns the
CGRectarea.Declaration
Swift
public var area: CGFloat { get } -
Mechanica
Returns a
CGRectrounded to an integral value using the specified roundingrule.Example:
CGRect(x: 10.3, y: 11.5, width: 12.7, height: 13.0).rounded(rule: .down) -> CGRect(x: 10, y: 11, width: 12, height: 13) CGRect(x: 10.3, y: 11.5, width: 12.7, height: 13.0).rounded(rule: .up) -> CGRect(x: 11, y: 12, width: 13, height: 13)Declaration
Swift
public func rounded(rule: FloatingPointRoundingRule) -> CGRect
CGRect Extension Reference