unexpectedly found nil while unwrapping an Optional value keyboardWillShow
问题 I have this code below which runs when the keyboardWillShowNotification is called: func keyboardWillShow(_ notification: Notification) { //ERROR IN THE LINE BELOW keyboard = (notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as AnyObject).cgRectValue animaton = (notification.userInfo?[UIKeyboardAnimationDurationUserInfoKey] as AnyObject).doubleValue UIView.animate(withDuration: 0.4, animations: { () -> Void in self.scrollView.frame.size.height = self.scrollViewHeight - self.keyboard