Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw Ellipse in Swift using UIBezierPath

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.

like image 375
borchero Avatar asked Nov 13 '14 18:11

borchero


1 Answers

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)
like image 98
Pathak Ayush Avatar answered Sep 24 '22 11:09

Pathak Ayush