Type Method

bezierPathWithArcCenter:radius:startAngle:endAngle:clockwise:

Creates and returns a new UIBezierPath object initialized with an arc of a circle.

Declaration

+ (instancetype)bezierPathWithArcCenter:(CGPoint)center radius:(CGFloat)radius startAngle:(CGFloat)startAngle endAngle:(CGFloat)endAngle clockwise:(BOOL)clockwise;

Parameters

center

Specifies the center point of the circle (in the current coordinate system) used to define the arc.

radius

Specifies the radius of the circle used to define the arc.

startAngle

Specifies the starting angle of the arc (measured in radians).

endAngle

Specifies the end angle of the arc (measured in radians).

clockwise

The direction in which to draw the arc.

Return Value

A new path object with the specified arc.

Discussion

This method creates an open subpath. The created arc lies on the perimeter of the specified circle. When drawn in the default coordinate system, the start and end angles are based on the unit circle shown in Figure 1. For example, specifying a start angle of 0 radians, an end angle of π radians, and setting the clockwise parameter to YES draws the bottom half of the circle. However, specifying the same start and end angles but setting the clockwise parameter set to NO draws the top half of the circle.

Figure 1

Angles in the default coordinate system

After calling this method, the current point is set to the point on the arc at the end angle of the circle.

See Also

Creating a UIBezierPath Object

bezierPath

Creates and returns a new UIBezierPath object.

bezierPathWithRect:

Creates and returns a new UIBezierPath object initialized with a rectangular path.

bezierPathWithOvalInRect:

Creates and returns a new UIBezierPath object initialized with an oval path inscribed in the specified rectangle

bezierPathWithRoundedRect:cornerRadius:

Creates and returns a new UIBezierPath object initialized with a rounded rectangular path.

bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:

Creates and returns a new UIBezierPath object initialized with a rounded rectangular path.

bezierPathWithCGPath:

Creates and returns a new UIBezierPath object initialized with the contents of a Core Graphics path.

bezierPathByReversingPath

Creates and returns a new Bézier path object with the reversed contents of the current path.

init

Creates and returns an empty path object.