         
         let rotationAnimation: CAAnimation = {
             let animation = CABasicAnimation(keyPath: "transform.rotation.z")
-            animation.fromValue = 0
-            animation.toValue = M_PI * 2
-            animation.duration = 4
+            animation.fromValue = startAngle
+            animation.toValue = Float.pi * 2
+            animation.duration = 2
             animation.repeatCount = MAXFLOAT
             return animation
         }()

        shapeLayer.add(rotationAnimation, forKey: "rotation")
        
        /*
        shapeLayer.strokeEnd = (CGFloat(M_PI * 2 * percentCircle))
        // Then apply the animation.
        var drawAnimation = CABasicAnimation(keyPath: "transform.rotation.x")
        drawAnimation.duration = 10
        drawAnimation.fromValue = CGPoint(x: 0, y: 0)
        drawAnimation.toValue = CGPoint(x: 100, y: 100)
        drawAnimation.repeatCount = Float.infinity
        //drawAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
        shapeLayer.add(drawAnimation, forKey: nil)
    */
/*
 

        self.activityImg3 = imageViewActivity3
        self.activityImg4 = imageViewActivity4
        
        
        let centreView = UIView()
               let centreFrame = CGRect(x: (self.view.frame.size.width/2) - 5, y: (self.view.frame.size.height/2) - 5, width: 10, height: 10)
centreView.frame = centreFrame
        centreView.backgroundColor = UIColor.orange
        self.view.addSubview(centreView)
        
//        view.addSubview(activityImg1)
//        view.addSubview(activityImg2)
//        view.addSubview(activityImg3)
//        view.addSubview(activityImg4)
        
        
        //drawCircle()
        /*
        drawCircle2()
       drawCircle3()
        drawCircle5()
        */
        
        
        //drawCircle4()
        //rep()
        
        //roatateOnce()
        
        let size = CGFloat(150)
        
       drawLab(percentage: 0.1, size: size, duration: 5)
        drawLab(percentage: 0.95, size: size * 0.9, duration: 2)
        drawLab(percentage: 0.75, size: size * 0.8, duration: 3)
        drawLab(percentage: 0.85, size: size * 0.7, duration: 4)

    }

