Vector

public protocol Vector

Allows CGPoint, CGSize and CGVector to be approximately interchangable You can do maths with mixed types You can easily convert between them For example: CGPoint() + CGSize() or CGSize() * 3 Extends accessors to apply to all types. So - cgPoint.width or cgSize.x are available

  • x

    Undocumented

    Declaration

    Swift

    var x: CGFloat { get set }
  • y

    Undocumented

    Declaration

    Swift

    var y: CGFloat { get set }
  • height Default implementation

    Undocumented

    Default Implementation

    Undocumented

    Declaration

    Swift

    var height: CGFloat { get set }
  • width Default implementation

    Undocumented

    Default Implementation

    Undocumented

    Declaration

    Swift

    var width: CGFloat { get set }
  • dx Default implementation

    Undocumented

    Default Implementation

    Undocumented

    Declaration

    Swift

    var dx: CGFloat { get set }
  • dy Default implementation

    Undocumented

    Default Implementation

    Undocumented

    Declaration

    Swift

    var dy: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    init(x: CGFloat, y: CGFloat)
  • Undocumented

    Declaration

    Swift

    init(_ vector: Vector)
  • floor() Default implementation

    Undocumented

    Default Implementation

    Round both components down to nearest int

    Declaration

    Swift

    func floor<T>() -> T where T : Vector
  • length Default implementation

    Undocumented

    Default Implementation

    Undocumented

    Declaration

    Swift

    var length: CGFloat { get }
  • isPositive Extension method

    Undocumented

    Declaration

    Swift

    var isPositive: Bool { get }
  • init(side:) Extension method

    Undocumented

    Declaration

    Swift

    init<T>(side: T) where T : FloatConvertible
  • cgPoint Extension method

    Cast to cgPoint

    Declaration

    Swift

    var cgPoint: CGPoint { get }
  • cgSize Extension method

    Cast to cgSize

    Declaration

    Swift

    var cgSize: CGSize { get }
  • cgVector Extension method

    cast to cgVector

    Declaration

    Swift

    var cgVector: CGVector { get }