title: Problems with dismiss keyboard notification trigging animation
body: <p>I have a placeholder that I am animating when the keyboard is opened and closed. So far when the keyboard is opened it animates properly, however when it is closed it stays in place. Below is the code I am using.</p>
  
  <pre><code>func setupKeyboardObservers() {
  
      NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
  
      NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification), name: NSNotification.Name.UIKeyboardWillHide, object: nil)
  }
  </code></pre>
  
  <p>Setting up the keyboard notifications</p>
  
  <pre><code>        let isKeyboardShowing = notification.name == NSNotification.Name.UIKeyboardWillShow
          let isKeybobardNotShowing = notification.name == NSNotification.Name.UIKeyboardWillHide
  </code></pre>
  
  <p>Here's where the animations happens</p>
  
  <pre><code>        DispatchQueue.main.async {
              if isKeyboardShowing {
  
                  NSLayoutConstraint(item: self.placeholder, attribute: .left, relatedBy: .equal, toItem: self.searchBarView, attribute: .left, multiplier: 1, constant: 5).isActive = true
                  UIView.animate(withDuration: 0.5, delay: 0, options: UIViewAnimationOptions.curveEaseOut, animations: {
                      self.view.layoutIfNeeded()
                  }, completion: { (completed) in
  
                  })
  
              }
          }
  
  
          DispatchQueue.main.async {
              if isKeybobardNotShowing {
  
                  NSLayoutConstraint(item: self.placeholder, attribute: .centerX , relatedBy: .equal, toItem: self.searchBarView, attribute: .centerX, multiplier: 1, constant: 0).isActive = true
                  UIView.animate(withDuration: 0.5, delay: 0, options: UIViewAnimationOptions.curveEaseOut, animations: {
                      self.view.layoutIfNeeded()
                  }, completion: { (completed) in
  
                  })
  
              }
          }
  </code></pre>
  
  <p>Any suggestions?</p>