-
-
Save tbatsuur/616f2cfde750a2dbac479ad2f6e13a23 to your computer and use it in GitHub Desktop.
Round UIViews
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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