Instance Property

position

The layer’s position in its superlayer’s coordinate space. Animatable.

Declaration

var position: CGPoint { get set }

Discussion

The value of this property is specified in points and is always specified relative to the value in the anchorPoint property. For new standalone layers, the default position is set to (0.0, 0.0). Changing the frame property also updates the value in this property.

For more information about the relationship between the frame, bounds, anchorPoint and position properties, see Core Animation Programming Guide.

See Also

Modifying the Layer Geometry

var frame: CGRect

The layer’s frame rectangle.

var bounds: CGRect

The layer’s bounds rectangle. Animatable.

var zPosition: CGFloat

The layer’s position on the z axis. Animatable.

var anchorPointZ: CGFloat

The anchor point for the layer’s position along the z axis. Animatable.

var anchorPoint: CGPoint

Defines the anchor point of the layer's bounds rectangle. Animatable.

var contentsScale: CGFloat

The scale factor applied to the layer.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software