ios - Keep previous UIBezierPath strokes on successive calls to drawRect -


I would like to mention that this post is similar, but there was no code snippet solution when it asked again. / P>

I am learning iOS development application. I'm trying to create a drawing application using UIBezierPath. Whenever a new touch to me and a new UIBezierPath I have the following to show your last UIBezierPath Please tell me what is better / recommended way each have To attract the beer path, there is a color array to keep track of color because I have the option of changing the colors for each path.

  - drawRect: (zero): (CGRect) rect // (4) {UIBezierPath * currentPath; UIColor * currentColor; (Int index = 0; index & lt; [Seshnshaithara Gates]; for index ++) (current path = [self path Arre object Art Index: Index]; CurrentColor = [self. Strokare Objektatindaks: Index] [existing collar Setstrok] [Wartmanpath stroke];}} - (void) touch that: (Anssiti *) touches the Avant (Uaiivent *) event {Uaitoc * touches the touch = [an object]; CGPoint p = [touch Location InViv: Self]; UIColor * Current St Roterolr; CurrentStrokeColor = [self-copy: self.strokeColor]; Self.path = [UIBezierPath bezierPath]; [Self. Path set linewidth: 2.0]; [Self. Perth Array object: Sopith] [itself. Strokare add objects turn Strotecolr] [Self Poth Muvto point: P];} - (void) enhanced touch (Ansset *) touches the Avant (UIEvent *) event {UITouch * touch = [anyObject touches]; CGPoint p = [Touch Position InViv: Self]; [self-athleteton: P]; // (4) [self setday display];}  

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -