title: How drawing signature with a pencil effect in objective C ?
body: <p>I try to developpe a new app based on drawing effects. I know simple effect, but i have seen some app with a brush effect (pencil effect). </p>
  
  <p>how to do somethink like this ? (SignNow app)</p>
  
  <p>Thanks </p>
  
  <p>You can see some example below. (first with my code and second i want the same effect)</p>
  
  <p>first :</p>
  
  <p><a href="http://hangeul.legtux.org/myapp.PNG" rel="nofollow">myapp drawing a signature</a></p>
  
  <p>second :</p>
  
  <p><a href="http://hangeul.legtux.org/signnow.PNG" rel="nofollow">signnow app i want same</a></p>
  
  <p>my code : </p>
  
  <pre><code>- (void)drawRect:(CGRect)rect {
  
  CGContextRef context = UIGraphicsGetCurrentContext();
  
  // Set drawing params
  CGContextSetLineWidth(context, self.lineWidth);
  CGContextSetStrokeColorWithColor(context, [self.foreColor CGColor]);
  CGContextSetLineCap(context, kCGLineCapButt);
  CGContextSetLineJoin(context, kCGLineJoinRound);
  CGContextBeginPath(context);
  
  
  
  
  // This flag tells us to move to the point
  // rather than draw a line to the point
  BOOL isFirstPoint = YES;
  
  // Loop through the strings in the array
  // which are just serialized CGPoints
  for (NSString *touchString in self.handwritingCoords) {
  
      // Unserialize
      CGPoint tapLocation = CGPointFromString(touchString);
  
      // If we have a CGPointZero, that means the next
      // iteration of this loop will represent the first
      // point after a user has lifted their finger.
      if (CGPointEqualToPoint(tapLocation, CGPointZero)) {
          isFirstPoint = YES;
          continue;
      }
  
  
      // If first point, move to it and continue. Otherwize, draw a line from
      // the last point to this one.
      if (isFirstPoint) {
          CGContextMoveToPoint(context, tapLocation.x, tapLocation.y);
  
  
  
  
              //CGContextAddArc(ctx, tapLocation.x, tapLocation.y, 30.00, (startDeg-90)*M_PI/180.0, (endDeg-90)*M_PI/180.0, 0);
          isFirstPoint = NO;
      } else {
          CGPoint startPoint = CGContextGetPathCurrentPoint(context);
          CGContextAddQuadCurveToPoint(context, startPoint.x, startPoint.y, tapLocation.x, tapLocation.y);
          CGContextAddLineToPoint(context, tapLocation.x, tapLocation.y);
      }
  
  }   
  
  // Stroke it, baby!
  CGContextStrokePath(context);
  </code></pre>
  
  <p>}</p>