I am trying to figure out a way to add or add a path (which I already did) and somehow set the location of the place where the path will be drawn.
Here is an example of what I am saying:
CGRect preMadeRect = CGRectMake(0.0f, 0.f, 50.f, 50.f);
CGPathRef preMadePath = CGPathCreateWithEllipseInRect(preMadeRect, NULL);
UIGraphicsBeginImageContext(self.view.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextMoveToPoint(context, 50.f, 50.f);
CGContextAddPath(context, preMadePath);
CGContextStrokePath(context);
UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageView *imageView = [[UIImageView alloc]initWithImage:resultImage];
[self.view addSubview: imageView];
Any ideas would be appreciated.
source
share