title: Subclass of UIButton with rounded corners (swift)
body: <p>Using swift, I'd like like to create a button with rounded corners. To make this re-usable, my preference is to subclass UIButton, and have come up with the following: </p>
  
  <pre><code>import Foundation
  import UIKit
  
  class LoginButton: UIButton {
  
    let corner_radius : CGFloat =  4.0
  
    override func drawRect(rect: CGRect) {
      super.drawRect(rect)
      self.layer.cornerRadius = corner_radius
    }
  
  }
  </code></pre>
  
  <p>Unfortunately, this doesn't seem to work as I had hoped, even though it compiles fine. Perhaps I'm missing something - I'm very new to this!</p>
  
  <p>Any ideas?</p>