let replicatorLayer = CAReplicatorLayer() let animation = CABasicAnimation(keyPath: #keyPath(CALayer.opacity))
let line = CALayer() let lineCount: Int = 12 let duration: TimeInterval = 1.0 let lineSize: CGSize = CGSize(width: 20, height: 6) let lineColor: UIColor = UIColor.darkGray
let angle = CGFloat.pi * 2 / CGFloat(lineCount) let rotation = CATransform3DMakeRotation(angle, 0, 0, 1.0)
// x: // y: half the height, changing affects rotation of lines line.position = CGPoint(x: 48, y: 75)
line.add(animation, forKey: nil)
Pay attention to position of the line. The larger the x, the closer to center. y should be half the height of the replicator layer size, changing it affects the skewness of the line.