title: Swift: Become First Responder on UITextField Not Working?
body: <p>I've created a custom UIViewController with one UITextField on Storyboard. On <code>viewDidLoad</code>, I set the UITextFIeld to <code>becomeFirstResponder</code>, nothing happened (no keyboards popped up). </p>
  
  <p>I then tried calling <code>resignFirstResponder()</code>, but it returned false. Next I tried to find who the <code>first responder</code> is through looping all the subviews using the code over @ <a href="https://stackoverflow.com/questions/1823317/get-the-current-first-responder-without-using-a-private-api">Get the current first responder without using a private API</a>. It turns out none of the sub views are the first responder.</p>
  
  <p>My ViewController in storyboard</p>
  
  <p><img src="https://i.stack.imgur.com/jm0tK.png" alt="enter image description here"></p>
  
  <p>My Code</p>
  
  <pre><code>class BLTestViewController: UIViewController, UITextFieldDelegate {
  
      @IBOutlet var tf: UITextField
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          tf.delegate = self
          tf.becomeFirstResponder()
          // Do any additional setup after loading the view.
      }
  }
  </code></pre>
  
  <p>As simple as it gets...WHY ISN'T THE KEYBOARD COMING UP!!! One thing I do have on is auto layout, but I'm not sure if that affects the keyboard popping up.</p>