iphone - How to remove CGContext for line in ios? -


i moving , adding lines these 2 lines.

  cgcontextmovetopoint(context, 20, 185);   cgcontextaddlinetopoint(context, 20, 185); 

i want know how can remove line (like cgcontextaddlinetopoint(context, 20, 185); //addline). want remove line when move or clear line color if array == 2;

then line color clear color or line remove position when moved forward.

any idea or suggestion highly welcome.

as long in drawrect: method, can draw line if needs , not if want clear it. drawrect: method gets called many times , view "cleared" before start drawing. code might this:

- (void)drawrect:(cgrect)rect {     // other drawing code , declaration of array variable...     if ([array count] == 2) {         cgcontextmovetopoint(context, 20, 185);         cgcontextaddlinetopoint(context, 20, 185);     } } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -