Drawing a bezier curve between a set of given points

后端 未结 6 1655
春和景丽
春和景丽 2021-02-13 13:40

What is the best way to draw a bezier curve, in iOS application, that passes through a set of given points

6条回答
  •  执念已碎
    2021-02-13 14:21

    UIBezierPath *aPath = [UIBezierPath bezierPath];
    
    // Set the starting point of the shape.
    [aPath moveToPoint:CGPointMake(100.0, 0.0)];
    
    // Draw the lines.
    [aPath addLineToPoint:CGPointMake(200.0, 40.0)];
    [aPath addLineToPoint:CGPointMake(160, 140)];
    [aPath addLineToPoint:CGPointMake(40.0, 140)];
    [aPath addLineToPoint:CGPointMake(0.0, 40.0)];
    [aPath closePath];
    

提交回复
热议问题