title: Using @objc delegate methods with multiple arguments
body: <p>I want to be able to pass multiple arguments to a <code>#selector()</code> method other than only the sender itself.</p>
  
  <p>Say, I have a <code>UITextField</code> which has a <code>UITapGestureRecognizer</code>, and I want some other class to be the delegate of this <code>UITapGestureRecognizer</code>. I write a delegate protocol for it called <code>SomeDelegateProcotol</code>. However, I also want to pass the instance of the UITextField to the delegate upon tap. I figured things might look something like this:  </p>
  
  <pre class="lang-swift prettyprint-override"><code>// The delegate
  class Delegate: SomeDelegateProcotol {
  
      private let textField = TextField()
  
      func handleTapFromView(_ sender: UITapGestureRecognizer, textField: UITextField) {
          print("Hey! I should handle the tap from the user.")
      }
  
      init() {
         textField.delegate = self
      }
  }
  </code></pre>
  
  <pre class="lang-swift prettyprint-override"><code>// The protocol
  @objc protocol SomeDelegateProtocol {
      @objc func handletapFromView(_ sender: UITapGestureRecognizer, textField: UITextField)
  }
  </code></pre>
  
  <pre class="lang-swift prettyprint-override"><code>class TextField: UITextField {
      weak var delegate: SomeDelegateProtocol?
  
      override init(frame: CGSize) {
          super.init(frame: frame)
          ...
          let gestureRecognizer = UITapGestureRecognizer(target: delegate!, 
              action: #selector(delegate!.handleTapFromView(_:, textField: 
              self)))
      } 
  }
  </code></pre>
  
  <p>However, this is not the right syntax, as <code>handleTapFromView(_:, textField: self)</code> is invalid. This raises the following questions to which I haven't found a solution yet:</p>
  
  <ul>
  <li>What exactly means this syntax? <code>(_:)</code>. I assume it's passing itself, but the <code>UITapGestureRecognizer</code> is not created yet?</li>
  <li>How do I successfully pass the TextField instance to the delegate alongside the sender?</li>
  </ul>