title: textFieldShouldReturn not being called after upgrade in Swift 4
body: <p>I have a view controller with a few <code>UITextField</code>s on it. When a <code>UITextField</code> has focus, if I tap on the Return key on the keyboard, I go to the next <code>UITextField</code>. If the next <code>UITextField</code> is below the keyboard, I move the view up.</p>
  
  <p>All was fine until yesterday when I upgraded the app to Swift 4, after a few changes. Now it's no longer working. I loaded the Swift 3 version and it's working just fine. The problem is I don't see any difference and I can't figure it out.</p>
  
  <p><a href="https://i.stack.imgur.com/evh2X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/evh2X.png" alt="UITextFields with Delegates"></a></p>
  
  <pre><code>class ServerWizardVC: UIViewController, UITextViewDelegate, UIDocumentMenuDelegate, UIDocumentPickerDelegate, FileManagerDelegate
  
  @IBOutlet weak var tfServerURL: UITextField!
  @IBOutlet weak var tfServerUser: UITextField!
  @IBOutlet weak var tfServerPassword: UITextField!
  @IBOutlet weak var tfServerPort: UITextField!
  
  override func viewDidLoad()
  {
      print("ServerWizardVC &gt; viewDidLoad")
  
      super.viewDidLoad()
  
      tfServerURL.tag = 0
  
      registerForKeyboardNotifications()
      deregisterFromKeyboardNotifications()
  }
  
  override func viewWillAppear(_ animated: Bool)
  {
      print("ServerWizardVC &gt; viewWillAppear")
  
      NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
  }
  
  func registerForKeyboardNotifications()
  {
      print("ServerWizardVC &gt; registerForKeyboardNotifications")
  
      NotificationCenter.default.addObserver(self, selector: #selector(keyboardWasShown), name: NSNotification.Name.UIKeyboardDidShow, object: nil)
      NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillBeHidden), name: NSNotification.Name.UIKeyboardDidShow, object: nil)
  }
  
  func deregisterFromKeyboardNotifications()
  {
      print("ServerWizardVC &gt; deregisterFromKeyboardNotifications")
  
      NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
      NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)
  }
  
  @objc func keyboardWillShow(notification:NSNotification)
  {
      print("ServerWizardVC &gt; keyboardWillShow")
  
      let userInfo:NSDictionary = notification.userInfo! as NSDictionary
      let keyboardFrame:NSValue = userInfo.value(forKey: UIKeyboardFrameEndUserInfoKey) as! NSValue
      let keyboardRectangle = keyboardFrame.cgRectValue
      let keyboardHeight = keyboardRectangle.height
  
      keyboardHeightValue = keyboardHeight
  }
  
  @objc func keyboardWasShown(notification: NSNotification)
  {
      print("ServerWizardVC &gt; keyboardWasShown")
  }
  
  @objc func keyboardWillBeHidden (notification: NSNotification)
  {
      print("ServerWizardVC &gt; keyboardWillBeHidden")
  }
  
  func textFieldShouldReturn(_ textField: UITextField) -&gt; Bool
  {
      print("ServerWizardVC &gt; textFieldShouldReturn")
  
      if let nextField = tfServerURL.superview?.viewWithTag(textField.tag + 1) as? UITextField
      {
          nextField.becomeFirstResponder()
  
          checkTextFieldPosition(tfTag: textField.tag + 1)
      }
      else
      {
          vMainView.frame.origin.y = 0
  
          textField.resignFirstResponder()
      }
  
      return false
  }
  
  func checkTextFieldPosition(tfTag : Int)
  {
      print("ServerWizardVC &gt; checkTextFieldPosition")
  
      let keyboardTop = mainViewHeight - keyboardHeightValue
      let tfServerPasswordTop =  tfServerPassword.frame.origin.y
  
      if(tfTag == 3)
      {
          if((keyboardTop &lt; tfServerPasswordTop) &amp;&amp; (vMainView.frame.origin.y == 0))
          {
              let yPosition = vMainView.frame.origin.y - keyboardHeightValue + 100
              vMainView.frame.origin.y = yPosition
          }
      }
  }
  </code></pre>
  
  <p>The reason I blame this on the Swift 4 upgrade is that I didn't even touch this class and everything else works fine.<br>
  Is there anything I'm missing?</p>