Michael Paniccia Michael Paniccia - 2 years ago 133
Swift Question

How to round edges of UILabel with Swift

I have looked in the attributes of labels in Xcode 6.3 but I have not found out how to round the edges in the same way that you can round the edges of a text field.

Answer Source

Assuming you have added a backgroundColor to your label otherwise there would be no way to tell if it had edges, you can use QuartzCore to round the edges of a label.

import QuartzCore

yourLabel.layer.backgroundColor  = UIColor.redColor().CGColor
yourLabel.layer.cornerRadius = 5
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download