         shapeLayer.addAnimation(startGroup, forKey: "start")
     }
     
-}
+}
        shapeLayer.fillColor = nil
        shapeLayer.strokeColor = UIColor(white: 1.0, alpha: 0.8).CGColor
        shapeLayer.lineWidth = 5.0
        self.backgroundView.layer.addSublayer(shapeLayer)
        
        let strokeEnd = CABasicAnimation(keyPath: "strokeEnd")
        strokeEnd.fromValue = 0.0

        let bgRect = CGRectMake(0, 0, max!, max!)
        
        backgroundView = UIView(frame: bgRect)
        backgroundView?.backgroundColor = attributes[RappleBGColorKey] as? UIColor
        backgroundView?.alpha = 1.0
        backgroundView?.userInteractionEnabled = false
        keyWindow?.addSubview(backgroundView!)
        
        
    }
    
    private func createProgressIndicator(){
        let keyWindow = UIApplication.sharedApplication().keyWindow
        
        let style = attributes[RappleIndicatorStyleKey] as? String
        
        if style != nil && style == RappleStyleApple {
            
            
            dispatch_async(dispatch_get_main_queue()) { () -> Void in
                
                let squre = UIView(frame: CGRectMake(0,0,150,100))
                squre.backgroundColor = UIColor(white: 0.0, alpha: 0.8)
                
                let indicator = UIActivityIndicatorView(activityIndicatorStyle: .WhiteLarge)
                indicator.center = CGPointMake(squre.center.x, squre.center.y-15)
                squre.addSubview(indicator)
                indicator.startAnimating()
                
                let label = UILabel(frame: CGRectMake(0, 0, (keyWindow?.bounds.size.width)! - 20, 21))
                label.center = CGPointMake(squre.center.x, squre.center.y + 20)
                label.textColor = self.attributes[RappleTintColorKey] as? UIColor
                label.textAlignment = .Center
                label.font = UIFont.boldSystemFontOfSize(16)
                label.text = self.text
                squre.addSubview(label)
                
                squre.layer.cornerRadius = 10.0
                squre.layer.masksToBounds = true
                squre.center = (keyWindow?.center)!
                
                self.backgroundView?.addSubview(squre)
            }
            
        } else {
            
            
            
            dispatch_async(dispatch_get_main_queue()) { () -> Void in
                
                let label = UILabel(frame: CGRectMake(0, 0, (keyWindow?.bounds.size.width)! - 20, 21))
                label.center = CGPointMake((keyWindow?.center.x)!, (keyWindow?.center.y)! + 40)
                label.textColor = self.attributes[RappleTintColorKey] as? UIColor
                label.textAlignment = .Center
                label.text = self.text
                self.backgroundView?.addSubview(label)
                
                self.addAnimatingCircle()
            }
        }
    }
    
