I have a TestView
inherited from UIView
, and everything is drawn on the screen using its drawRect
method.
But if I don't want drawRect
to clear the view before drawing, I used
self.clearsContextBeforeDrawing = NO;
self.opaque = NO; // also added because the doc says the rect
// passed to drawRect will be filled with
// background color first if it is set to YES
in the initWithFrame
method.
The drawRect
method is invoked by using
[self.view setNeedsDisplay];
in the ViewController
event handler. (for touchesMoved events)
But still, everything is cleared before anything is drawn? How to make it work?