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
-
Undocumented
Declaration
Swift
var x: CGFloat { get set } -
Undocumented
Declaration
Swift
var y: CGFloat { get set } -
heightDefault implementationUndocumented
Default Implementation
Undocumented
Declaration
Swift
var height: CGFloat { get set } -
widthDefault implementationUndocumented
Default Implementation
Undocumented
Declaration
Swift
var width: CGFloat { get set } -
dxDefault implementationUndocumented
Default Implementation
Undocumented
Declaration
Swift
var dx: CGFloat { get set } -
dyDefault implementationUndocumented
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 implementationUndocumented
Default Implementation
Round both components down to nearest int
Declaration
Swift
func floor<T>() -> T where T : Vector -
lengthDefault implementationUndocumented
Default Implementation
Undocumented
Declaration
Swift
var length: CGFloat { get } -
isPositiveExtension methodUndocumented
Declaration
Swift
var isPositive: Bool { get } -
init(side:Extension method) Undocumented
Declaration
Swift
init<T>(side: T) where T : FloatConvertible -
cgPointExtension methodCast to cgPoint
Declaration
Swift
var cgPoint: CGPoint { get } -
cgSizeExtension methodCast to cgSize
Declaration
Swift
var cgSize: CGSize { get } -
cgVectorExtension methodcast to cgVector
Declaration
Swift
var cgVector: CGVector { get }
Vector Protocol Reference