I am trying to make a UILabel in Swift a perfect circle. I am currently using the following:
pResult.layer.masksToBounds = true
pResult.layer.cornerRadius =
Create UILabel extension
extension UILabel {
func addBadge(badgeCount: String) {
self.text = badgeCount
self.textColor = UIColor.white
self.textAlignment = .center
self.font = UIFont.systemFont(ofSize: 14.0)
self.layer.cornerRadius = 0.5 * self.bounds.size.width
self.layer.backgroundColor = UIColor.orange.cgColor
}