title: Swift error: Can't assign value of type UIColor to type CGColor
body: <p>I have two input fields in my view, <code>loginEmailInput</code> and <code>loginPasswordInput</code>.</p>
  
  <p>I'm trying to change the border color. My code in <code>ViewController.swift</code> looks like so:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UITextFieldDelegate {
  
      @IBOutlet weak var loginPasswordInput: UITextField!
      @IBOutlet weak var loginEmailInput: UITextField!
  
      let borderColor : UIColor = UIColor(red:0.39, green:0.76, blue:0.37, alpha:1)
      loginEmailInput.layer.borderColor = borderColor
      loginPasswordInput.layer.borderColor = borderColor
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          //etc....
  </code></pre>
  
  <p>However, both these lines show an error:</p>
  
  <pre><code>loginEmailInput.layer.borderColor = borderColor
  loginPasswordInput.layer.borderColor = borderColor
  </code></pre>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>Can't assign value of type UIColor to type CGColor</p>
  </blockquote>
  
  <p>How do I solve this issue?</p>