title: Why Unrecognized selector sent to instance?
body: <p>I'm trying to make a convenient Binding keyboard to a uiview function. I can't get across this error</p>
  
  <blockquote>
    <p>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Twitter.LoginVC handleKeyboard:]: unrecognized selector sent to instance 0x7ffbf142e970'</p>
  </blockquote>
  
  <pre><code>class KeyboardService {
  
  var constraint: NSLayoutConstraint!
  var vc: UIViewController!
  
  func bind(bottomConstraint: NSLayoutConstraint, vc: UIViewController) {
      constraint = bottomConstraint
      self.vc = vc
      NotificationService.instance.addKeyboardObservers(onVC: vc, handleKeyboardSelector: #selector(self.handleKeyboard(_:))) // **CRASHES HERE**
  }
  
  @objc func handleKeyboard(_ notification: NSNotification) {
      NotificationService.instance.handleKeyboard(notification: notification, bottomConstraint: constraint, vc: vc)
  } 
  }
  </code></pre>
  
  <p>Here's my notificationService:</p>
  
  <pre><code>class NotificationService {
  static let instance  = NotificationService()
  
  func addKeyboardObservers(onVC vc: UIViewController, handleKeyboardSelector: Selector) {
      NotificationCenter.default.addObserver(vc, selector: handleKeyboardSelector, name: UIResponder.keyboardWillShowNotification, object: nil)
      NotificationCenter.default.addObserver(vc, selector: handleKeyboardSelector, name: UIResponder.keyboardWillHideNotification, object: nil)
  }
  }
  </code></pre>
  
  <p>EDIT:</p>
  
  <pre><code>class KeyboardService {
  
  var constraint: NSLayoutConstraint!
  var vc: UIViewController!
  
  func bind(bottomConstraint: NSLayoutConstraint, vc: UIViewController) {
      constraint = bottomConstraint
      self.vc = vc
      NotificationService.instance.addKeyboardObservers(self, handleKeyboardSelector: #selector(self.handleKeyboard(_:)))
  }
  
  @objc func handleKeyboard(_ notification: NSNotification) {
      NotificationService.instance.handleKeyboard(notification: notification, bottomConstraint: constraint, vc: vc)
  }
  </code></pre>
  
  <p>}</p>
  
  <p>EDIT 2:</p>
  
  <pre><code>class KeyboardService {
  
  var constraint: NSLayoutConstraint!
  var vc: UIViewController!
  
  func bind(bottomConstraint: NSLayoutConstraint, vc: UIViewController) {
      constraint = bottomConstraint
      self.vc = vc
      NotificationService.instance.addKeyboardObservers(self, handleKeyboardSelector: #selector(handleKeyboard(_:)))
  }
  
  @objc func handleKeyboard(_ notification: NSNotification) {
      NotificationService.instance.handleKeyboard(notification: notification, bottomConstraint: constraint, vc: vc)
  }
  }
  </code></pre>
  
  <p>In viewDidLoad() of a vc:</p>
  
  <pre><code>KeyboardService().bind(bottomConstraint: loginBtnBackViewBottomConstraint, vc: self)
  </code></pre>