I have an UIViewController
in which I want to draw a ellipse on the screen starting at CGPoint(x:160,y:160)
, width:240
, height:320
. How can I do that in swift?
I would really much appreciate any help.
let shapeLayer = CAShapeLayer()
shapeLayer.path = ovalPath.cgPath
shapeLayer.fillColor = UIColor.clear.cgColor
shapeLayer.strokeColor = UIColor.blue.cgColor
shapeLayer.lineWidth = 5.0
self.layer.addSublayer(shapeLayer)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With