I'm moving a UIView up when the keyboard is called, works fine in the simulator but when i run the code on an actual device for whatever reason the UIKeyboardWillShow notification is called twice. I am not using any custom keyboards.

In the viewDidLoad method i call this method.

```
func registerKeyBoardNotifications(){
    NotificationCenter.default.addObserver(self, selector: #selector(keyBoardWillAppear(notification:)), name: .UIKeyboardWillShow, object: nil)
    NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillBeHidden(notification:)), name: .UIKeyboardWillHide, object: nil)
}

```

Then remove these observers in viewWillDisappear.

```
@objc func keyBoardWillAppear(notification: NSNotification){
    if let userInfo = notification.userInfo,
       let endFrame = userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue,
       let beginFrame = userInfo[UIKeyboardFrameBeginUserInfoKey] as? NSValue,
       beginFrame.isEqual(to: endFrame) == false{
          let keyboardSize = endFrame.cgRectValue
          self.view.frame.origin.y -= keyboardSize.height - keyboardConstant
          signUpButton.isEnabled = false
    }
}

```

the keyboardWillAppear handler is called twice on a physical device but once in the simulator, spent the last 2 days trying to figure this out.

Xcode 9.4.1 swift 4.1