     private var progressLayer : CAShapeLayer?
     private var borderLayer : CAShapeLayer?
     
+    public required init(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+        self.contentMode = .Redraw
+        self.backgroundColor = UIColor.clearColor()
+    }
+    
+    public override init(frame: CGRect) {
+        super.init(frame: frame)
+        self.contentMode = .Redraw
+        self.backgroundColor = UIColor.clearColor()
+    }
+    
+    public override func drawRect(rect: CGRect) {
+        super.drawRect(rect)
+        updateProgress()
+    }
+    
     public var progress : CGFloat = 0 {
         willSet(v) {
             if v > 1.0 || v < 0.0 {

        arc.fill()
        progressLayer?.path = arc.CGPath
        progressLayer?.fillColor = self.tintColor.CGColor
    }
    
    override public func layoutSubviews() {
        super.layoutSubviews()
        if(borderLayer == nil) {
            //backgroundColor = UIColor.clearColor()
            let circle = UIBezierPath(ovalInRect: self.bounds)
            circle.stroke()
            borderLayer = CAShapeLayer()
            borderLayer?.fillColor = UIColor.clearColor().CGColor
            borderLayer?.strokeColor = tintColor.CGColor
            borderLayer?.lineWidth = 2.0
            borderLayer?.path = circle.CGPath
            self.layer.addSublayer(borderLayer!)
        }
    }

}

        }
        didSet {
            dispatch_async(dispatch_get_main_queue(), {
                //self.updateProgress()
                self.setNeedsDisplay()
                if(self.progress == 0 || self.progress >= 1) {
                    self.hidden = true
                }
