A structure that contains a two-dimensional vector.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Graphics
Declaration
struct CGVector
A structure that contains a two-dimensional vector.
SDKs
Framework
struct CGVector
static var zero: CGVector
The vector whose components are both zero.
init()
Creates a vector whose components are both zero.
var dx: CGFloat
The x component of the vector.
var dy: CGFloat
The y component of the vector.
init(dx: Double, dy: Double)
Creates a vector with components specified as floating-point values.
init(dx: CGFloat, dy: CGFloat)
Creates a vector with components specified as CGFloat
values.
init(dx: Int, dy: Int)
Creates a vector with components specified as integer values.
struct CGFloat
The basic type for floating-point scalar values in Core Graphics and related frameworks.
struct CGPoint
A structure that contains a point in a two-dimensional coordinate system.
struct CGSize
A structure that contains width and height values.
struct CGRect
A structure that contains the location and dimensions of a rectangle.
struct CGAffine Transform
An affine transformation matrix for use in drawing 2D graphics.