Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>An implementation of the response given by @omz could be:<br> (assuming <code>imgBlank</code> is a <code>UIImageView</code> placed on top of the main view of the viewcontroller)</p> <pre><code>-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{     UITouch *touch = [touches anyObject];     CGPoint currentPoint = [touch locationInView:self.imgBlank];     NSValue *valCurrPoint=[NSValue valueWithCGPoint:CGPointMake(currentPoint.x, currentPoint.y)];     [self.dots addObject:valCurrPoint];     [self performSelector:@selector(draw:) withObject:valCurrPoint afterDelay:0]; } -(void)draw:(NSValue*)pointz{     CGPoint point=[pointz CGPointValue];     UIGraphicsBeginImageContextWithOptions(self.imgBlank.frame.size,NO,0);     [self.imgBlank.image drawInRect:CGRectMake(0, 0, self.imgBlank.frame.size.width, self.imgBlank.frame.size.height)];     CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);     CGContextSetLineWidth(UIGraphicsGetCurrentContext(),tickness);//set the tickness here     CGContextSetBlendMode(UIGraphicsGetCurrentContext(), kCGBlendModeClear);     CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 1.0f, 1.0f, 1.0f, 1.0);     CGContextBeginPath(UIGraphicsGetCurrentContext());       CGContextSetShouldAntialias(UIGraphicsGetCurrentContext(), YES);     CGContextMoveToPoint(UIGraphicsGetCurrentContext(), _lastPoint.x, _lastPoint.y);     CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), point.x, point.y);     CGContextStrokePath(UIGraphicsGetCurrentContext());     self.imgBlank.image = UIGraphicsGetImageFromCurrentImageContext();     UIGraphicsEndImageContext();     _lastPoint = point; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload