title: Swift 3 #selector and type names
body: <p>Just updated to Xcode8 with Swift 3.  Unfortunately, I am unable to add a target to a button where the target refers to a function in another class.</p>
  
  <pre><code>class AddToDoViewController {
    @IBOutlet weak var doneButton: UIButton!
    var st : SelectorTest!
  
    override func viewDidLoad() {
        st = SelectorTest()
  
        st.didTapButtonHandler = {
          self.doneButton.isSelected = !self.doneButton.isSelected
          print("self.doneButton.selected=\(self.doneButton.isSelected)")
        }
  
        doneButton.addTarget(self, action: #selector(SelectorTest.didTapTheButton(_:)), for: .touchUpInside)
    }
  }
  
  
  class SelectorTest {
      typealias ToDoCellDidTapButtonHandler = () -&gt; Void
      var didTapButtonHandler: ToDoCellDidTapButtonHandler?
  
      @objc func didTapTheButton(_ sender: AnyObject) {
          if let handler = didTapButtonHandler {
              handler()
          }
      }
  }
  </code></pre>
  
  <p>In this case the target is SelectorTest.didTapButton(_:) which exists in the SelectorTest class.  However when I run and click on the button I get a runtime error: </p>
  
  <pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', 
  reason: '-[Done.AddToDoViewController didTapTheButton:]: 
  unrecognized selector sent to instance 
  </code></pre>
  
  <p>Since I configured the target on the button to point to</p>
  
  <pre><code>SelectorTest.didTapTheButton(_:)
  </code></pre>
  
  <p>which definitely exists, why am I getting a runtime error stating that it cannot find <code>didTapTheButton(_:)</code> on the AddToDoViewController?  Especially when I did not specify <code>AddToDoViewController.didTapTheButton(_:)</code> as the target?  </p>
  
  <pre><code>Done.AddToDoViewController didTapTheButton:
  </code></pre>
  
  <p>I am wondering if the <code>#selector</code> ignores the class name and assumes that the target is on the class that added the target to the button (AddToDoViewController)?</p>
  
  <p>How can I set the target to <code>SelectorTest.didTapTheButton(_:)</code> and at runtime have the <code>SelectorTest.didTapTheButton(_:)</code> execute instead of the runtime attempting to fire the <code>AddToDoViewController.didTapTheButton(_:)</code> which is not the configured target and doesn't exist?</p>