CGRect

public extension CGRect
extension CGRect: SpringInterpolatable, VelocityProviding
  • Creates a CGRect of a given size, centered at a given point.

    Declaration

    Swift

    init(aroundPoint point: CGPoint, size: CGSize, integralized: Bool = false)

    Parameters

    point

    The desired center point of the new rect.

    size

    The desired size of the new rect.

    integralized

    Whether the components of the rect should be integralized, such that it falls on pixel boundaries. See scaledIntegral for more information.

  • Returns a rect whose origin and size are rounded to the nearest pixel boundary, taking into account the device’s display scale.

    Declaration

    Swift

    var scaledIntegral: CGRect { get }
  • The center point of the rect.

    Declaration

    Swift

    var center: CGPoint { get set }
  • The top-left point of the rect.

    Declaration

    Swift

    var topLeft: CGPoint { get }
  • The top-right point of the rect.

    Declaration

    Swift

    var topRight: CGPoint { get }
  • The bottom-left point of the rect.

    Declaration

    Swift

    var bottomLeft: CGPoint { get }
  • The bottom-right point of the rect.

    Declaration

    Swift

    var bottomRight: CGPoint { get }
  • Declaration

    Swift

    public typealias ValueType = CGRect
  • Declaration

    Swift

    public typealias VelocityType = CGRect
  • Declaration

    Swift

    public static func updateValue(spring: Spring, value: CGRect, target: CGRect, velocity: CGRect, dt: TimeInterval) -> (value: CGRect, velocity: CGRect)