     
     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
+      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
+      shapeLayer.path = UIBezierPath(ovalIn: self.bounds).cgPath
     }
     layer.mask = shapeLayer
     setupLabels()

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

  
  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()
  }
