Skip to content

Animating the drawing of a CGPath with CAShapeLayer.strokeEnd

License

Notifications You must be signed in to change notification settings

Yak0xff/AnimatedPaths

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnimatedPaths

Animating the drawing of a CGPath with the help of CAShapeLayer.strokeEnd.

The Objective-C Version is here.

Drawing Rectangle Path:

RCAnimatedPath.shared.drawAnimatedRectanglePath(in: targetView,
                                                           duration: 3,
                                                           lineWidth: 5,
                                                           lineColor: UIColor.red)

Drawing Polygon Path:

RCAnimatedPath.shared.drawAnimatedPolygonPath(in: targetView,
                                                          numberOfSides: 8,
                                                          rotationAngle: 10,
                                                          polygonCornerRadius: 4,
                                                          duration: 3,
                                                          lineWidth: 5,
                                                          lineColor: UIColor.gray)

Drawing Text:

RCAnimatedPath.shared.drawAnimatedText(in: targetView,
                                                   with: "Hello Swift!",
                                                   duration: 3,
                                                   lineWidth: 2,
                                                   textColor: UIColor.blue,
                                                   fontName: "PingFangSC-Bold",
                                                   fontSize: 50)

Drawing Custom Path:

RCAnimatedPath.shared.drawAnimatedCustomPath(in: targetView,
                                                         path: ringPath.cgPath,
                                                         duration: 3,
                                                         lineWidth: 2,
                                                         lineColor: UIColor.black)

About

Animating the drawing of a CGPath with CAShapeLayer.strokeEnd

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages