#import<Foundation/Foundation.h>#import<CoreGraphics/CoreGraphics.h>#import<UIKit/UIKitDefines.h>ns_assume_nonnull_begintypedef ns_options (Nsuinteger, Uirectcorner) {Uirectcornertopleft=1<<0, Uirectcornertopright=1<<1, Uirectcornerbottomleft=1<<2, Uirectcornerbottomright=1<<3, Uirectcornerallcorners= ~0UL}; Ns_class_available_ios (3_2)@interfaceUibezierpath:nsobject<nscopying, nssecurecoding>//Initialize+(instancetype) Bezierpath;//Initialize a rectangular path+(Instancetype) Bezierpathwithrect: (cgrect) rect;//Initializes an elliptical path, tangent to the four edges of the rectangle. +(Instancetype) Bezierpathwithovalinrect: (cgrect) rect;//Initializes a rounded rectangle with a corner radius of the rectangular area+(Instancetype) Bezierpathwithroundedrect: (cgrect) Rect Cornerradius: (cgfloat) Cornerradius;/** Initialize rounded rectangle @param rect Rectangle area @param Corners enumeration: Which corner is rounded (multiple ' | ') Apart) @param cornerradii fillet radius*/+(Instancetype) Bezierpathwithroundedrect: (cgrect) rect byroundingcorners: (uirectcorner) Corners cornerRadii: ( cgsize) cornerradii;/** Initialize an open ARC Path @param Center Center @param radius Radius @param startangle start angle (0-M_PI) @param endangle End angle @param clockwise is No clockwise*/+(Instancetype) Bezierpathwitharccenter: (cgpoint) Center radius: (cgfloat) Radius startangle: (cgfloat) startangle Endangle: (cgfloat) Endangle clockwise: (BOOL) clockwise;//Initialize objects based on Cgpath+(Instancetype) Bezierpathwithcgpath: (CGPATHREF) Cgpath;-(instancetype) init ns_designated_initializer;-(Nullable Instancetype) Initwithcoder: (Nscoder *) Adecoder Ns_designated_initializer;//set the path, or you can get an immutable path! @property (nonatomic) cgpathref Cgpath;-(cgpathref) Cgpath ns_returns_inner_pointer cf_returns_not_retained;//move to Current point- (void) moveToPoint: (cgpoint) point;//draw a line at the current point- (void) Addlinetopoint: (cgpoint) point;/** Add a three-time Bezier curve @param endPoint end point @param controlPoint1 control point 1 @param controlPoint2 Control point 2*/- (void) Addcurvetopoint: (cgpoint) endPoint controlPoint1: (cgpoint) controlPoint1 ControlPoint2: (cgpoint) ControlPoint2 ;/** Add a two-time Bezier curve @param endPoint end point @param controlpoint Control Point*/- (void) Addquadcurvetopoint: (cgpoint) endPoint controlpoint: (cgpoint) controlpoint;/** Append an arc @param center point @param radius radius @param startangle start angle @param endangle end angle @param clockwise clockwise*/- (void) Addarcwithcenter: (cgpoint) Center radius: (cgfloat) Radius startangle: (cgfloat) startangle endangle: (cgfloat) Endangle clockwise: (BOOL) clockwise Ns_available_ios (4_0);//Closed Path- (void) Closepath;//Remove all Paths- (void) removeallpoints;//Append Bezierpath- (void) Appendpath: (Uibezierpath *) Bezierpath;//draw the original Uibezierpath in the opposite direction (two paths, same direction)-(Uibezierpath *) Bezierpathbyreversingpath Ns_available_ios (6_0);//for radiation, 2D transformation- (void) Applytransform: (cgaffinetransform) transform;//Path Info@property (ReadOnly, getter=isempty) BOOL empty;//whether the path is empty@property (Nonatomic,ReadOnly) CGRect bounds;//Path Area@property (Nonatomic,ReadOnly) Cgpoint Currentpoint;//Current Point-(BOOL) Containspoint: (cgpoint) point;//whether to include a point//Drawing Properties@property (nonatomic) cgfloat linewidth;//line width@property (nonatomic) Cglinecap Linecapstyle;//Curve End Style enumeration@property (nonatomic) Cglinejoin Linejoinstyle;//style enumeration at curve join@property (nonatomic) cgfloat miterlimit;//The Linejoinstyle value at the junction is Kcglinejoinmiter, inner angle and outer corner distance, maximum limit@property (nonatomic) cgfloat flatness;//rendering accuracy (default 0.6), the smaller the value, the higher the precision, the more time-consuming! @property (nonatomic) BOOL usesevenoddfillrule;//whether to use a base-even fill rule (default is no 0 rule)/** Draw a dashed path @param pattern C-language array cgfloat xx[] = {segment length, gap length}, rotation @param count array number @param phase from the first few numbers*/- (void) Setlinedash: (NullableConstCGFloat *pattern Count: (Nsinteger) Count phase: (cgfloat) phase;/** Gets the dash style @param pattern array (space must be greater than the path space) @param count array number @param phase start number of digits*/- (void) Getlinedash: (Nullable cgfloat *) pattern Count: (Nullable Nsinteger *) Count phase: (Nullable cgfloat *) phase;- (void) Fill;//Fill- (void) stroke;//Draw Line/** Mixed fill @param blendmode Fill Mode enumeration @param alpha Transparency*/- (void) Fillwithblendmode: (cgblendmode) Blendmode Alpha: (cgfloat) Alpha;/** Mixed Draw line @param Blendmode Mode enumeration @param alpha Transparency*/- (void) Strokewithblendmode: (cgblendmode) Blendmode Alpha: (cgfloat) Alpha;//paths can only be drawn in areas after clipping paths- (void) Addclip;@endNs_assume_nonnull_end
Introduction to the Uibezierpath Bezier properties for iOS