Instance Property

center

The center of the frame.

Declaration

var center: CGPoint { get set }

Discussion

The center is specified within the coordinate system of its superview and is measured in points. Setting this property changes the values of the frame properties accordingly.

Changing the frame rectangle automatically redisplays the receiver without invoking the draw(_:) method. If you want the draw(_:) method invoked when the frame rectangle changes, set the contentMode property to redraw.

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.

See Also

Configuring the Bounds and Frame Rectangles

var frame: CGRect

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

var bounds: CGRect

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

var transform: CGAffineTransform

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