         self.addSubview(valueLabel)
     }
     
-    public func setValue(_ newVal: CGFloat, animated: Bool) {
+    public func setValue(_ newVal: CGFloat, animated: Bool, completion: () -> Void) {
         self.value = newVal
         if animated {
             animateInnerRing()
         }
         
     }
+    
+    private lazy var startTime = CACurrentMediaTime()
+    private lazy var link = CADisplayLink()
     
     func animateInnerRing() {
         let animation = CABasicAnimation(keyPath: "strokeEnd")

    var toRads: CGFloat { return self * CGFloat(M_PI) / 180 }
}

@IBDesignable
public class UICircularProgressRingView: UIView {
    
    // MARK: Value properties
    
    /// The value of the current progress. Range [0, maxValue]
    @IBInspectable public var value: CGFloat = 0 {
        didSet {
            self.setNeedsDisplay()
        }
    }
    /// The value of the maximum amount of progress. Range [0, ∞]
    @IBInspectable public var maxValue: CGFloat = 100 {
        didSet {

        animation.isRemovedOnCompletion = false
        animation.fillMode = kCAFillModeForwards
        shapeLayer.add(animation, forKey: "animateInnerRing")
        
        valueLabel.text = "\(self.oldValue)"
        link = CADisplayLink(target: self, selector: #selector(self.animateLabel))
        link.add(to: RunLoop.current, forMode: .commonModes)
    }
    
    
    @objc private func animateLabel() {
        let dt = (link.timestamp - self.startTime) / animationDuration
        
        if (dt >= 1.0) {
            valueLabel.update(withValue: value, valueIndicator: valueIndicator,
                              showsDecimal: showFloatingPoint, decimalPlaces: decimalPlaces)
            
            link.remove(from: RunLoop.current, forMode: .commonModes)
            return
        }
        
        let current = (self.value - self.oldValue) * CGFloat(dt) + self.oldValue
        
        valueLabel.update(withValue: current, valueIndicator: valueIndicator,
                          showsDecimal: showFloatingPoint, decimalPlaces: decimalPlaces)
    }
    
    private func update(withValue: CGFloat) {
        
    }
}
