     path.addLineToPoint(CGPoint(x: path.currentPoint.x, y: originY))    
     return path
   }
+
+  
+  // MARK: - Private helper
+  
+  private func drawPath(path: UIBezierPath) {
+    layer.mask?.removeFromSuperlayer()
+    
+    let maskLayer = CAShapeLayer()
+    maskLayer.frame = CGRect(origin: CGPoint.zero, size: bounds.size)
+    maskLayer.path = path.CGPath
+    layer.mask = maskLayer
+  }
+  
+  private func degree2radian(degree: CGFloat) -> CGFloat {
+    let radian = CGFloat(M_PI) * degree / 180
+    return radian
+  }
+  
+  private func pointFrom(angle: CGFloat, radius: CGFloat, offset: CGPoint) -> CGPoint {
+    return CGPoint(x: radius * cos(angle) + offset.x, y: radius * sin(angle) + offset.y)
+  }
+  
+  private func retrieveMaskParameters(mask: String, maskName: String) -> String {
+    var params = mask.stringByReplacingOccurrencesOfString(" ", withString: "")
+    params = params.stringByReplacingOccurrencesOfString(maskName, withString: "")
+    params = params.stringByReplacingOccurrencesOfString("(", withString: "")
+    params = params.stringByReplacingOccurrencesOfString(")", withString: "")
+    return params
+  }
   
 }

    } else {
      maskWave()
    }
  }
  
  private func maskWaveBezierPath(waveUp: Bool, waveWidth: CGFloat, waveOffset: CGFloat) -> UIBezierPath {

  
  // MARK: - Triangle

  private func maskTriangle() {
    let trianglePath = maskTriangleBezierPath()
    drawPath(trianglePath)
  }
  
  private func maskTriangleBezierPath() -> UIBezierPath {
    let path = UIBezierPath()
    path.moveToPoint(CGPoint(x: bounds.width / 2.0, y: bounds.origin.y))
