title: Trigger textFieldShouldReturn from UIBarButtonItem
body: <p>I am trying to add a <code>UIBarButtonItem</code> that triggers my <code>textFieldShouldReturn</code>, but I get this error:</p>
  
  <blockquote>
    <p>Argument of '#selector' does not refer to an '@objc' method, property, or initializer</p>
  </blockquote>
  
  <p><strong>UIBarButtonItem</strong></p>
  
  <pre><code>func addToolBar(textField: UITextField) {
      let toolBar = UIToolbar()
      toolBar.barStyle = .default
      let doneButton = UIBarButtonItem(
              title: "Done",
              style: .done,
              target: self,
              action: #selector(textFieldShouldReturn(textField))) //** ERROR **
      toolBar.isUserInteractionEnabled = true
      toolBar.sizeToFit()
      textField.inputAccessoryView = toolBar
  }
  </code></pre>
  
  <p><strong>textFieldShouldReturn:</strong></p>
  
  <pre><code>@objc func textFieldShouldReturn(_ textField: UITextField) {
    print("hi there!")
  }
  </code></pre>
  
  <p>The error suggests that I should need to add <code>objc</code> to my <code>textFieldShouldReturn</code>, but I already have that.  I also already tried the following:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/41511973/argument-of-selector-does-not-refer-to-an-objc-method-property-or-initia/41512253">Argument of &#39;#selector&#39; does not refer to an &#39;@objc&#39; method, property, or initializer</a></li>
  <li><a href="https://stackoverflow.com/questions/45090845/argument-of-selector-does-not-refer-to-an-objc-method">Argument of &#39;#selector&#39; does not refer to an &#39;@objc&#39; method</a></li>
  <li><a href="https://stackoverflow.com/questions/40334786/argument-of-selector-does-not-refer-to-an-initializer-or-method">Argument of &#39;#selector&#39; does not refer to an initializer or method</a></li>
  <li><a href="https://stackoverflow.com/questions/24641350/how-to-set-the-action-for-a-uibarbuttonitem-in-swift">How to set the action for a UIBarButtonItem in Swift</a></li>
  </ul>
  
  <p><strong>Does anyone understand how I can set up my <code>UIBarButtonItem</code> to trigger my <code>textFieldShouldReturn</code>?</strong></p>