     var toRads: CGFloat { return self * CGFloat(M_PI) / 180 }
 }
 
+extension UILabel {
+    func update(withValue value: CGFloat, valueIndicator: String, showsDecimal: Bool, decimalPlaces: Int) {
+        if showsDecimal {
+            self.text = String(format: "%.\(decimalPlaces)f", value) + "\(valueIndicator)"
+        } else {
+            self.text = "\(Int(value))\(valueIndicator)"
+        }
+        self.sizeToFit()
+    }
+}
+
 @IBDesignable
-public class UICircularProgressRingView: UIView {
+public class UICircularProgressRingView: UIView, CAAnimationDelegate {
     
     // MARK: Value properties
     
     /// The value of the current progress. Range [0, maxValue]
     @IBInspectable public var value: CGFloat = 0 {
-        didSet {
-            self.setNeedsDisplay()
-        }
-    }
+        willSet {
+            print("========== OLD \(self.value)")
+            self.oldValue = self.value
+        }
+        didSet {
+            self.setNeedsDisplay()
+        }
+    }
+    
+    private var oldValue: CGFloat = 0.0
+    
     /// The value of the maximum amount of progress. Range [0, ∞]
     @IBInspectable public var maxValue: CGFloat = 100 {
         didSet {

            self.setNeedsDisplay()
        }
    }
    
    public var animationDuration: CFTimeInterval = 1.0
    public var animationStyle: String = kCAMediaTimingFunctionEaseIn
    
    private lazy var shapeLayer = CAShapeLayer()
    
    
    // MARK: Methods

    
    /// Draws the value label inside of the progress rings
    private func drawValueLabel() {
        valueLabel.update(withValue: value, valueIndicator: valueIndicator,
                          showsDecimal: showFloatingPoint, decimalPlaces: decimalPlaces)
        
        valueLabel.font = UIFont.systemFont(ofSize: fontSize)
        valueLabel.textAlignment = .center
        valueLabel.textColor = textColor
