title: Rounded corners of UILabel swift
body: <p>I am creating a <code>UILabel</code> programatically. But the below piece of code doesn't give me rounded corners. I think I am missing out something very basic.        </p>
  
  <pre><code>var textLabel:UILabel? =  UILabel()
  textLabel?.text = text
  textLabel?.frame = CGRect(x:point.x, y:point.y, width:(textLabel?.intrinsicContentSize.width)!, height:15)
  textLabel?.backgroundColor = UIColor.white
  textLabel?.font = UIFont(name:"OpenSans", size:8)
  textLabel?.sizeToFit()
  textLabel?.layer.cornerRadius = 20.0
  </code></pre>
  
  <p>Can anyone please point me in the right direction?</p>