 
     override func viewDidLoad() {
         super.viewDidLoad()
-        let imageView = UIImageView(frame: viewMain.bounds)
-        imageView.image = UIImage(named: "dog.jpg")
-        imageView.contentMode = .ScaleAspectFit
         viewMain.addSubview(imageView)
         viewMain.addSubview(maskView)
     }


class ViewController: UIViewController {
    @IBOutlet var viewMain:UIView!
    var layers = [CALayer]()
    var xform = CGAffineTransformIdentity

    var builder = SNPathBuilder(minSegment: 8.0)
    lazy var shapeLayer:CAShapeLayer = {
        let layer = self.createShapeLayer()
        layer.opacity = 0.8
        self.viewMain.layer.addSublayer(layer)
        return layer
    }()
    lazy var maskView:UIImageView = {
        let maskView = UIImageView(frame: self.viewMain.bounds)
        maskView.contentMode = .ScaleAspectFit
        return maskView
    }()
    
    private func createShapeLayer() -> CAShapeLayer {

        layer.lineWidth = 10
        layer.fillColor = UIColor.clearColor().CGColor
        layer.strokeColor = UIColor(red: 1, green: 0, blue: 1, alpha: 1).CGColor
        layer.shadowRadius = 2.0
        layer.shadowColor = layer.strokeColor
        layer.shadowOpacity = 1.0
        layer.shadowOffset = CGSize.zero
        layer.lineCap = "round"
        layer.lineJoin = "round"
        return layer
