         animation.toValue = 1
         
         // Do a linear animation (i.e. the speed of the animation stays the same)
-        animation.timingFunction = curve.mediaTimingFunction
+        animation.timingFunction = animationCurve.mediaTimingFunction
         
-        // Set the arcLayer's strokeEnd property to 1.0 now so that it's the
+        // Set the shapeLayer's strokeEnd property to 1.0 now so that it's the
         // right value when the animation ends.
-        arcLayer.strokeEnd = 1.0
+        shapeLayer.strokeEnd = 1.0
         
         // Do the actual animation
-        arcLayer.add(animation, forKey: "animate")
+        shapeLayer.add(animation, forKey: "animate")
     }
     
     // MARK: UIView
     
-    override func didMoveToWindow() {
+    open override func didMoveToWindow() {
         super.didMoveToWindow()
         animate()
     }
     
 }
+
+fileprivate extension UIViewAnimationCurve {
+    
+    var mediaTimingFunctionString: String {
+        switch self {
+        case .linear: return kCAMediaTimingFunctionLinear
+        case .easeIn: return kCAMediaTimingFunctionEaseIn
+        case .easeOut: return kCAMediaTimingFunctionEaseOut
+        case .easeInOut: return kCAMediaTimingFunctionEaseInEaseOut
+        }
+    }
+    
+    var mediaTimingFunction: CAMediaTimingFunction {
+        return CAMediaTimingFunction(name: mediaTimingFunctionString)
+    }
+
+}


import UIKit

@IBDesignable class ArcView: UIView {
    
    // MARK: - IBInspecatble variables

    @IBInspectable var start: CGFloat = -0.25
    @IBInspectable var end: CGFloat = 0.75
    @IBInspectable var lineWidth: CGFloat = 2
    @IBInspectable var duration: TimeInterval = 3.0
    @IBInspectable var fillColor: UIColor = .clear
    @IBInspectable var strokeColor: UIColor = .blue
    
    @IBInspectable var curveInt: Int {
        get {
            return curve.rawValue
        }
        set {
            curve = Curve(rawValue: newValue) ?? .linear
        }
    }
    
    @IBInspectable var isPaused = false {
        didSet {
            if oldValue != isPaused {
                if !isPaused {

        }
    }
    
    // MARK: - Variables

    open var animationCurve: UIViewAnimationCurve = .linear
    
    open lazy var bezierPath: UIBezierPath = UIBezierPath(
        arcCenter: CGPoint(x: self.bounds.midX, y: self.bounds.midY),
        radius: min(self.bounds.midX, self.bounds.midY) - self.lineWidth / 2,
        startAngle: CGFloat(self.start) * 2 * .pi,
        endAngle: CGFloat(self.end) * 2 * .pi,
        clockwise: self.start < self.end
    )
    
    let shapeLayer = CAShapeLayer()
    
    // MARK: - Init
    
