Slide 46
Slide 46 text
let pathAnimation = CABasicAnimation(keyPath: #keyPath(CAShapeLayer.path))
shapeLayer.add(pathAnimation, forKey: "pathAnimation")
pathAnimation.toValue = triangle.cgPath
pathAnimation.duration = 1.0
pathAnimation.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
pathAnimation.autoreverses = true
pathAnimation.repeatCount = .greatestFiniteMagnitude