let width:CGFloat = SKScale(float: 60)
let height:CGFloat = SKScale(float: 60)
let animationView = UIView()
animationView.bounds = CGRect(x: 0, y: 0, width: width, height: height)
animationView.center = self.view.center
self.view.addSubview(animationView)
animationView.backgroundColor = UIColor.gray
animationView.clipsToBounds = true
let animationLayer = CAShapeLayer()
animationLayer.backgroundColor = UIColor.hexColor(color: "616B82").cgColor
animationLayer.bounds = CGRect(x: 0, y: 0, width: SKScale(float: 5.2 * 2), height: SKScale(float: 5.2 * 2))
animationLayer.position = CGPoint(x: width/2, y: SKScale(float: 5.2 * 3))
animationLayer.borderColor = UIColor.white.cgColor
animationLayer.cornerRadius = SKScale(float: 5.2 * 2)/2
animationLayer.borderWidth = 1
animationLayer.transform = CATransform3DMakeScale(0.1, 0.1, 0.1)
let transformAnim = CABasicAnimation(keyPath: "transform")
transformAnim.duration = 0.8
transformAnim.repeatCount = HUGE
transformAnim.fromValue = NSValue.init(caTransform3D: CATransform3DMakeScale(1, 1, 1))
transformAnim.toValue = NSValue.init(caTransform3D: CATransform3DMakeScale(0.1, 0.1, 0.1))
animationLayer.add(transformAnim, forKey: nil)
replicatorLayer = CAReplicatorLayer()
replicatorLayer.backgroundColor = UIColor.yellow.cgColor
replicatorLayer.frame = CGRect(x: 0, y: 0, width: width, height: height)
replicatorLayer.addSublayer(animationLayer);
replicatorLayer.instanceCount = 8
replicatorLayer.instanceDelay = 0.1
let angle = CGFloat(2*M_PI) / CGFloat(8)
replicatorLayer.instanceTransform = CATransform3DMakeRotation(angle, 0, 0, 1.0)
animationView.layer.addSublayer(replicatorLayer)