Skip to content

Instantly share code, notes, and snippets.

@tbatsuur
Created November 18, 2018 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbatsuur/616f2cfde750a2dbac479ad2f6e13a23 to your computer and use it in GitHub Desktop.
Save tbatsuur/616f2cfde750a2dbac479ad2f6e13a23 to your computer and use it in GitHub Desktop.
Round UIViews
func roundItUp(to cornerRadius: CGFloat? = nil) {
if let corner = cornerRadius {
self.layer.cornerRadius = corner
}else {
self.layer.cornerRadius = self.frame.height / 2
}
self.clipsToBounds = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment