title: Change the border color of uitextfield
body: <p>I added bottom border to <code>UITextField</code> this way:</p>
  
  <pre><code>let bottomLine = CALayer()
  bottomLine.frame = CGRectMake(0.0, self.frame.height, self.frame.width, CGFloat(borderWidth))
  bottomLine.backgroundColor = borderColor.CGColor
  self.borderStyle = UITextBorderStyle.None
  self.layer.addSublayer(bottomLine)
  </code></pre>
  
  <p>How can I change the border color of this bottom line when <code>UITextField</code> call <code>textFieldDidBeginEditing()</code> and then change back color to default when it calls <code>textFieldDidEndEditing()</code></p>
  
  <p>I'm using a custom class of <code>UITextField</code></p>