Skip to content

Instantly share code, notes, and snippets.

@kichiemon
Created July 27, 2019 12:45
Show Gist options
  • Save kichiemon/25af2f7a7c15c441765773a50eae95be to your computer and use it in GitHub Desktop.
Save kichiemon/25af2f7a7c15c441765773a50eae95be to your computer and use it in GitHub Desktop.
extension UIView {
func drawCircle() {
let circlePath = UIBezierPath(ovalIn: self.bounds)
let circleShape = CAShapeLayer(layer: self.layer)
circleShape.frame = self.bounds
circleShape.path = circlePath.cgPath
circleShape.strokeColor = ColorName.primary.color.cgColor
circleShape.fillColor = Color.clear.cgColor
circleShape.lineWidth = 0.8
self.layer.addSublayer(circleShape)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment