     
     }
     
-    
-    
-    func drawCircle(){
-    
-        let percentCircle = 0.75
+
+    func drawLab(percentage: Double, size: CGFloat,  duration: Double){
+    
+        
+        let percentCircle = percentage
         let circleCenter = CGPoint(x: self.view.frame.size.width/2, y: self.view.frame.size.height/2)
-        let circleRadius = CGFloat(150)
+        let circleRadius = size
         let startAngle = CGFloat(0)
         let endAngle = CGFloat((M_PI * 2 * percentCircle))
         
-        let circlePath = UIBezierPath(arcCenter: circleCenter, radius: circleRadius, startAngle: startAngle, endAngle:endAngle, clockwise: true)
-        
-
+
+        
+         let circlePath = UIBezierPath(arcCenter: circleCenter, radius: circleRadius, startAngle: startAngle, endAngle:endAngle, clockwise: true)
+        
+        
+        
+        let shapeLayer = CAShapeLayer()
+        shapeLayer.path = circlePath.cgPath
+        
+        
+        shapeLayer.fillColor = UIColor.clear.cgColor
+        shapeLayer.strokeColor = UIColor.black.cgColor
+        shapeLayer.lineWidth = 2
+        // shapeLayer.backgroundColor = UIColor.blue.cgColor
+
+        shapeLayer.frame = CGRect(x: (self.view.frame.size.width/2) - (circleRadius/2), y: (self.view.frame.size.height/2) - (circleRadius/2), width: circleRadius, height: circleRadius)
+        shapeLayer.bounds =  shapeLayer.frame
+        self.view.layer.addSublayer(shapeLayer)
+        
+        let rotationAnimation: CAAnimation = {
+            let animation = CABasicAnimation(keyPath: "transform.rotation.z")
+            animation.fromValue = startAngle
+            animation.toValue = Float.pi * 2
+            animation.duration = duration
+            animation.repeatCount = Float.infinity
+            return animation
+        }()
+        
+        shapeLayer.add(rotationAnimation, forKey: "rotation")
+    
+    }
+    
+    func drawCircle(){
+    
+        let percentCircle = 0.1
+        let circleCenter = CGPoint(x: self.view.frame.size.width/2, y: self.view.frame.size.height/2)
+        let circleRadius = CGFloat(120)
+        let startAngle = CGFloat(0)
+        let endAngle = CGFloat((M_PI * 2 * percentCircle))
+        
+        //let circlePath = UIBezierPath(arcCenter: circleCenter, radius: circleRadius, startAngle: startAngle, endAngle:endAngle, clockwise: true)
+        //let arcWidth: CGFloat = 76
+        
+        let circlePath = UIBezierPath(arcCenter: circleCenter, radius: circleRadius, startAngle: startAngle, endAngle: endAngle, clockwise: true)
         
         let shapeLayer = CAShapeLayer()
         shapeLayer.path = circlePath.cgPath

        self.activityImg3 = imageViewActivity3
        self.activityImg4 = imageViewActivity4
        
        view.addSubview(activityImg1)
        view.addSubview(activityImg2)
        view.addSubview(activityImg3)
        view.addSubview(activityImg4)
        
        drawCircle()
        
        roatateOnce()

    }


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