I am trying to make some circles inside a UIImageView with a specific image. This is what I tried to do:
UIGraphicsBeginImageContext(self.view.bounds.size); CGContextRef contextRef = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(contextRef, 2.0); CGContextSetStrokeColorWithColor(contextRef, [color CGColor]); CGRect circlePoint = (CGRectMake(coordsFinal.x, coordsFinal.y, 50.0, 50.0)); CGContextStrokeEllipseInRect(contextRef, circlePoint); UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); [photoView addSubview:image];
The circle is drawn perfectly, but I would like the PhotoView to act as a mask for it. Therefore, if, for example, I move a UIImageView from a UIView using animation, I would like the circle to move with it. The important thing is that the coordinates apply to the entire screen.
source share