How to erase lines from view by using eraser?
I am creating a view with multiples lines and some other shapes by using UI-Graphics-Get-Current-Context()
. My application is similar to Paint. After drawing some lines and shapes when I try to erase them it removes all. Because in drawRect I had taken: UIGraphics-Begin-Image-Context(self.frame.size)
.
self.frame.size
creates drawing on whole frame. And I am deleting shapes by using:
for (UIView *view in self.subviews) {
if(CGRect-ContainsPoint(view.frame, touch Location))
[view removeFromSuperview];
}
This code deletes the other image View perfectly. But it deletes all lines without touching them (because the lin开发者_运维问答e view frame is self.frame
).
How to change the frame of plotted lines after drawing?
精彩评论