The Uibezierpath class can represent any shape that can be defined with Bézier curves, and we can create our own custom curves. When you are done, you can use the resulting Uibezierpath object to fill and stroke like any other path.
1, the following demonstrates drawing an irregular graphic using Uibezierpath:
(1) The brush moves to the upper-left corner of the rectangular area
(2) Draw a straight line from the point of the pen's current position to the top right corner
(3) Draw a straight line from the point of the pen's current position to the lower-left corner
(4) Draw a curve from the pen's current position to the lower right corner, and the two control points of the curve bending degree are the midpoint of the rectangular region
(5) Draw a straight line from the point to the top left of the pen's current position, closing the path
2, the effect chart is as follows:
3, the code is as follows: