在此页面底部有一个有趣的动画。它基本上是使用
我该如何生成这些
CAShapeLayer
和UIPanGestureRecognizer
进行动画处理。
(来源:ronnqvi.st)
- (CGPathRef)loadPath
{
CGMutablePathRef path = CGPathCreateMutable();
// load
CGPathMoveToPoint(path, NULL, 7.50878897, 25.2871097);
CGPathAddCurveToPoint(path, NULL, 7.50878897, 25.2871097, 21.7333976, 26.7812495, 29.6894527, 20.225586);
CGPathAddCurveToPoint(path, NULL, 37.6455074, 13.6699219, 39.367189, 3.85742195, 31.9697262, 1.25976564);
CGPathAddCurveToPoint(path, NULL, 24.5722639, -1.33789083, 21.99707, 10.9072268, 21.99707, 22.2255862);
CGPathAddCurveToPoint(path, NULL, 21.9970685, 33.5439456, 15.9355469, 45.8212894, 8.99707031, 47.7294922);
...
我该如何生成这些
CGPath
值?任何示例都会有所帮助。
CGPath
。我的意思是通过手指触摸绘制一个小应用程序,并记录其路径。 - Coldsteel48