Instance Property

transform

Specifies the transform applied to the receiver, relative to the center of its bounds.

Declaration

var transform: CGAffineTransform { get set }

Discussion

The origin of the transform is the value of the center property, or the layer’s anchorPoint property if it was changed. (Use the layer property to get the underlying Core Animation layer object.) The default value is CGAffineTransformIdentity.

Changes to this property can be animated. Use the beginAnimations(_:context:) class method to begin and the commitAnimations() class method to end an animation block. The default is whatever the center value is (or anchor point if changed)

In iOS 8.0 and later, the transform property does not affect Auto Layout. Auto layout calculates a view’s alignment rectangle based on its untransformed frame.

See Also

Related Symbols

var frame: CGRect

The frame rectangle, which describes the view’s location and size in its superview’s coordinate system.

var center: CGPoint

The center of the frame.

var bounds: CGRect

The bounds rectangle, which describes the view’s location and size in its own coordinate system.