I have the following code which worked on IOS 10, but now it doesn\'t work anymore when running on IOS 11 beta.
if let userInfo = notification.userInfo {
if
I used this code in my app with Swif 3+
var userInfo = notification.userInfo
if let keyboardFrame = (userInfo?[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue{
print(keyboardFrame.height)
if keyboardFrame.size.height <= 0 { // To fix bug on iOS 11
if let newKeyboardFrame = (userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue{
print(newKeyboardFrame.height)
}
}
}
view.layoutIfNeeded()