I\'m currently looking at a UILabel with the property addMessageLabel.layer.cornerRadius = 5.0f;
On a device with iOS 7.0 installed, it has rounded corners. On a de
yourlabelname.layer.cornerRadius = yourlabelname.frame.size.width/2;
[yourlabelname setClipsToBounds:YES];
Make sure you are checking with appropriate Deployment target.
//works perfect in Swift 2.0 for a circular or round image
@IBOutlet var theImage: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
//Make sure the width and height are same
self.theImage.layer.cornerRadius = self.theImage.frame.size.width / 2
self.theImage.layer.borderWidth = 2.0
self.theImage.layer.borderColor = UIColor.whiteColor().CGColor
self.theImage.clipsToBounds = true
}