I'm using
Where penLayer is a UIView
UIGraphicsBeginImageContext(penLayer.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
//My Drawing Code
penLayer.image = UIGraphicsGetImageFromCurrentImageContext();
[penLayer setNeedsDisplay];
This draws great but each time I call drawRect it wipes out what was before Currently I'm having to save all drawing data to a dictionary
Is there anyway to prevent it from clearing out with each call to drawRect and perhaps have a UIButton that calls clear when needed ?
Thanks