My purpose is to export UIImage
from the UIView
. so I want to add clear border over red circle so the output image looks like 2nd image.
Now I want something like that: I want to add clear background over the red circle so the output image look something like below image. (I know if I add clear border then I can't achieve this so please suggest me to achieve this)
Here I have just added only color, This 2 color are actually images
Edit
I'm able to do this by using the below code but the cutting area is not rounding.
func cut(hole: CGRect, inView v: UIView) {
let p:CGMutablePath = CGMutablePath()
p.addRect(CGRect.init(x: v.frame.origin.x, y: v.frame.origin.y, width: v.frame.width, height: v.frame.height))
p.addRect(hole)
let s = CAShapeLayer()
s.path = p
s.fillRule = CAShapeLayerFillRule.evenOdd
v.layer.mask = s
}
Here is my Demo Link: https://gofile.io/?c=jukO6B
Current Output
Any help will be appreciated to do this.