title: Free hand painting and erasing using UIBezierPath and CoreGraphics
body: <p>I have been trying so much but have no solution find out yet. I have to implement the painting and erasing on iOS so I successfully implemented the painting logic using <code>UIBezierPath</code>. The problem is that for erasing, I implemented the same logic as for painting by using <code>kCGBlendModeClear</code> but the problem is that I cant redraw on the erased area and this is because in each pass in drawRect i have to stroke both the painting and erasing paths. So is there anyway that we can subtract erasing path from drawing path to get the resultant path and then stroke it. I am very new to Core Graphics and looking forward for your reply and comments. Or any other logic to implement the same. I can't use eraser as background color because my background is textured.</p>