title: How to only show bottom border of UITextField in Swift
body: <p>I want to show <strong>only</strong> bottom border and hide the other sides.</p>
  
  <p>Output I see: As you can see I see the top, left and right borders also and they are black in color, I want to remove them. Only need the bottom white thick 2.0 border.</p>
  
  <p><img src="https://i.stack.imgur.com/awl8T.png" alt="enter image description here"></p>
  
  <p>Code I am using (<a href="https://stackoverflow.com/questions/26800963/uitextfield-border-for-bottom-side-only-in-swift">source</a>):</p>
  
  <pre><code>var border = CALayer()
  var width = CGFloat(2.0)
  border.borderColor = UIColor.whiteColor().CGColor
  border.frame = CGRect(x: 0, y: tv_username.frame.size.height - width, width: tv_username.frame.size.width, height: tv_username.frame.size.height)
  
  border.borderWidth = width
  tv_username.backgroundColor = UIColor.clearColor()
  tv_username.layer.addSublayer(border)
  tv_username.layer.masksToBounds = true
  tv_username.textColor = UIColor.whiteColor()
  </code></pre>