+ (UIBezierPath *)bezierPath;
//创建UIBezierPath UIBezierPath *path = [UIBezierPath bezierPath];2.创建矩形
+ (UIBezierPath *)bezierPathWithRect:(CGRect)rect;
3.使用UIBezierPath创建圆形或者椭圆形:正方形是圆。长方形是椭圆
+ (UIBezierPath *)bezierPathWithOvalInRect:(CGRect)rect;
4.创建圆角矩形
+ (UIBezierPath *)bezierPathWithRoundedRect:(CGRect)rect cornerRadius:(CGFloat)cornerRadius
5.任意角弧度
+ (UIBezierPath *)bezierPathWithRoundedRect:(CGRect)rect byRoundingCorners:(UIRectCorner)corners cornerRadii:(CGSize)cornerRadii;
6.创建一个弧线
+ (UIBezierPath *)bezierPathWithArcCenter:(CGPoint)center radius:(CGFloat)radius startAngle:(CGFloat)startAngle endAngle:(CGFloat)endAngle clockwise:(BOOL)clockwise;
7.初始线段的起点
- (void)moveToPoint:(CGPoint)point;
8.添加线上的点- (void)addLineToPoint:(CGPoint)point
- (void)addCurveToPoint:(CGPoint)endPoint controlPoint1:(CGPoint)controlPoint1 controlPoint2:(CGPoint)controlPoint2
ndPoint:曲线的终点
controlPoint1:画曲线的第一个基准点
controlPoint2:画曲线的第二个基准点
10. //画二元曲线,一般和moveToPoint配合使用- (void)addQuadCurveToPoint:(CGPoint)endPoint controlPoint:(CGPoint)controlPoint;
参数:
endPoint:曲线的终点
controlPoint:画曲线的基准点
11.12.
关闭path,这个方法会自动连接最后点和起始点
画圆弧
- (void)closePath;
13。删除所有的点
- (void)removeAllPoints;