Where frontImage is image view on which clear operation will perform. As you can see here we are defining delegate methods with CGContext. And we are drawing Rect for frontImage image and clear content over it. With current context, we are clearing content with CGContextSetBlendMode method.
Clearing content will be performed with the help of line path which we draw to clear. lastTouch is used to get the point at starting the touch and currentTouch are points which got by moving touch.