Swift 3 NSNotificationCenter Keyboardwillshow/hide
<p>I have a piece of code that worked in Swift 2 and I tried using Xcode to update the code to the newest version and I fixed everything except two issues.</p>

<p>I have this code :</p>

<pre><code>let loginvc: LoginVC = self.storyboard?.instantiateViewController(withIdentifier: "LoginVC") as! LoginVC
NotificationCenter.defaultCenter().addObserver(self, selector: #selector(LoginViewController.keyboardWillShow(_:)), name: UIKeyboardWillShowNotification, object: nil)
NotificationCenter.defaultCenter().addObserver(self, selector: #selector(LoginViewController.keyboardWillHide(_:)), name: UIKeyboardWillHideNotification, object: nil)
</code></pre>

<p>That pairs along with this:</p>

<pre><code>func keyboardWillShow(notification: NSNotification) {

    constraint.constant = -100
    UIView.animate(withDuration: 0.3) {
        self.view.layoutIfNeeded()
    }
}

func keyboardWillHide(notification: NSNotification) {

    constraint.constant = 25
    UIView.animate(withDuration: 0.3) {
        self.view.layoutIfNeeded()
    }
}
</code></pre>

<p>On the first part I now get an error saying </p>

<blockquote>
  <p>Type 'LoginViewController' has no member 'keyboardWillShow/Hide'</p>
</blockquote>

<p>I don't understand why it is not seeing the method underneath.</p>

<p>Does anybody know a solution to this issue?</p>