     private func renderLayers(range:Range<Int>) {
         UIGraphicsBeginImageContext(image.size)
         let context = UIGraphicsGetCurrentContext()!
-        maskView.image?.drawInRect(CGRect(origin: .zero, size: image.size))
+        imageView.image?.drawInRect(CGRect(origin: .zero, size: image.size))
         CGContextConcatCTM(context, imageTransform)
         CGContextSetBlendMode(context, CGBlendMode.DestinationOut)
         for i in range {
             layers[i].renderInContext(context)
         }
-        maskView.image = UIGraphicsGetImageFromCurrentImageContext()
+        imageView.image = UIGraphicsGetImageFromCurrentImageContext()
         UIGraphicsEndImageContext()
     }
 }


    override func viewDidLoad() {
        super.viewDidLoad()
        viewMain.addSubview(maskView)
        updateUI()
    }


        self.viewMain.layer.addSublayer(layer)
        return layer
    }()
    lazy var imageView:UIImageView = {
        let view = UIImageView(frame: self.viewMain.bounds)
        view.image = self.image
        view.contentMode = .ScaleAspectFit
