                 return
             }
         }
-        self.delegate?.didFinish()
-        self.shapeLayer.isHidden = true
-        self.label.isHidden = true
+        delegate?.didFinish()
+        shapeLayer.isHidden = true
+        label.isHidden = true
     }
 }
 

    
    func start(max:Int){
        self.max = max
        self.shapeLayer.isHidden = false
        self.label.isHidden = false
        self.label.text = "\(max)"
        let animation = CABasicAnimation(keyPath: "strokeEnd")
        animation.duration = 0.8
        animation.fromValue = 0.0

        let startAngle = CGFloat(-M_PI_2)
        let endAngle = startAngle + 2.0 * CGFloat(M_PI)
        let path = UIBezierPath(arcCenter: center, radius: radius, startAngle: startAngle, endAngle: endAngle, clockwise: true)
        shapeLayer.path = path.cgPath
        layer.addSublayer(self.shapeLayer)
        
        label.frame = CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.height)
        label.center = CGPoint(x: self.bounds.size.width / 2.0, y: self.bounds.size.height / 2.0)
        label.textAlignment = NSTextAlignment.center
        label.font = UIFont.boldSystemFont(ofSize: 100)
        addSubview(label)
    }
    
    required init?(coder aDecoder: NSCoder) {
