         shapeLayer.fillColor = UIColor.clear.cgColor
         shapeLayer.lineWidth = innerRingWidth
         shapeLayer.strokeEnd = 1.0
-        shapeLayer.lineCap =  String(innerRingStyle)
-        shapeLayer.lineJoin = String(innerRingStyle)
+        shapeLayer.lineCap = inCapStyle
+        shapeLayer.lineJoin = inCapStyle
         
         self.layer.addSublayer(shapeLayer)
     }

        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,

            self.setNeedsDisplay()
        }
    }
    @IBInspectable public var innerRingCapStyle: Int = 2 {
        didSet {
            switch self.innerRingCapStyle {
            case 1: self.inCapStyle = kCALineCapButt
            case 2: self.inCapStyle = kCALineCapRound
            case 3: self.inCapStyle = kCALineCapSquare
            default: self.inCapStyle = kCALineCapButt
            }
            
            self.setNeedsDisplay()
        }
    }
    private var inCapStyle: String = kCALineCapButt
    
    
    // MARK: Label
    /// The label for the value, will change an animate when value is set
    lazy private var valueLabel: UILabel = UILabel(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
    
    @IBInspectable public var shouldShowValueText: Bool = true {
        didSet {
            self.setNeedsDisplay()
        }
    }
    
    @IBInspectable public var textColor: UIColor = UIColor.black {
        didSet {
            self.setNeedsDisplay()
