A while ago I remember seeing a constant of some kind that defined the animation rate of the Keyboard on the iPhone and I can not for the life of me remember where I saw it.
Swift 4 - worked for me:
if let duration = notification.userInfo?[UIKeyboardAnimationDurationUserInfoKey] as? Double { UIView.animate(withDuration: duration, animations: { self.view.layoutIfNeeded() }) }
In debug mode my duration was 3.499999
duration
3.499999