   
   func handleTap(sender: UITapGestureRecognizer) {
    print("Tapped!")
-   if sender.state == .Ended {
+   if sender.state == .ended {
     // handling code
        print("Tap ended!")
    }

    
    switch cornerType {
    case .Rounded:
      shapeLayer.path = UIBezierPath(roundedRect: bounds, byRoundingCorners: [UIRectCorner.TopLeft,  UIRectCorner.TopRight, UIRectCorner.BottomLeft, UIRectCorner.BottomRight], cornerRadii: CGSize(width: 30, height: 30)).CGPath
    case .Circle:
      shapeLayer.path = UIBezierPath(ovalInRect: self.bounds).CGPath
    }
    layer.mask = shapeLayer
    setupLabels()

  
  func setupLabels() {
    shapeButtonLabel.numberOfLines = 1;
    shapeButtonLabel.baselineAdjustment = UIBaselineAdjustment.alignBaselines
    shapeButtonLabel.adjustsFontSizeToFitWidth = true
    shapeButtonLabel.frame = self.bounds
    shapeButtonLabel.backgroundColor = UIColor.clear
    shapeButtonLabel.text = self.labelText
    shapeButtonLabel.textColor = UIColor.white
    shapeButtonLabel.font = UIFont.systemFont(ofSize: 28.0)
    shapeButtonLabel.textAlignment = .center
    shapeButtonLabel.drawText(in: self.bounds)
    self.addSubview(shapeButtonLabel)
    self.setNeedsDisplay()
  }
