     
     func stopAnimating() {
         
-        activityIndicator.stopAnimating()
-        label.alpha = 1
+        //activityIndicator.stopAnimating()
+        self.shapeLayer.removeAllAnimations()
+        
         var scrollView = superview as UIScrollView
         var insets = scrollView.contentInset
         UIView.animateWithDuration(0.3, animations: {

        UIView.animateWithDuration(0.3, delay: 0, options:nil, animations: {
            scrollView.contentInset = UIEdgeInsets(top: 50, left: insets.left, bottom: insets.bottom, right: insets.right)
            }, completion: {finished in
                self.activityIndicator.startAnimating()
                self.pullToRefreshAction()
                scrollView.bounces = true
        })

    override init(frame: CGRect) {
        
        pullToRefreshAction = {}
        shapeLayer = CAShapeLayer()
        super.init(frame: frame)
        backgroundColor = UIColor(red: 0.97, green: 0.97, blue: 0.97, alpha: 1)
        label.frame = bounds
        label.textAlignment = .Center
        label.textColor = UIColor.blackColor()
        label.text = "pull to refresh"
        addSubview(label)
        
        
        
        //shapeLayer.path = UIBezierPath(ovalInRect:CGRect(x: frame.height / 2 - 15, y: frame.height / 2 - 15, width: 30, height: 30)).CGPath;
        //// Bezier Drawing
        var bezierPath = UIBezierPath()
        bezierPath.moveToPoint(CGPointMake(0, frame.height - 2))
        bezierPath.addLineToPoint(CGPoint(x: frame.width, y: frame.height - 2))
        
        shapeLayer.path = bezierPath.CGPath
        shapeLayer.lineWidth = 4

        //[UIColor colorWithRed:0.12 green:0.49 blue:0.98 alpha:1]
        shapeLayer.strokeColor = UIColor(red: 0.12, green: 0.49, blue: 0.98, alpha: 1).CGColor
        shapeLayer.fillColor = UIColor.greenColor().CGColor
        shapeLayer.strokeEnd = 0
        //shapeLayer.strokeEnd = 0.5
        layer.addSublayer(shapeLayer)
    }
    
    public required init(coder aDecoder: NSCoder) {
        
        pullToRefreshAction = {}
        shapeLayer = CAShapeLayer()
        super.init(coder: aDecoder)
    }
    
    deinit {
