Get Keyboard Height Swift

[Solved] Get Keyboard Height Swift | Swift - Code Explorer | yomemimo.com
Question : get keyboard height swift

Answered by : aris-g

NotificationCenter.default.addObserver( self, selector: #selector(keyboardWillShow), name: UIResponder.keyboardWillShowNotification, object: nil
)
@objc func keyboardWillShow(_ notification: Notification) { if let keyboardFrame: NSValue = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue { let keyboardRectangle = keyboardFrame.cgRectValue let keyboardHeight = keyboardRectangle.height }
}

Source : https://stackoverflow.com/questions/31774006/how-to-get-height-of-keyboard | Last Update : Wed, 08 Jul 20

Question : how to get the height of keyboard xcode

Answered by : encouraging-eland-ol9hnz3fcuoq

@objc func keyboardWillShow(_ notification: Notification) { if let keyboardFrame: NSValue = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue { let keyboardRectangle = keyboardFrame.cgRectValue let keyboardHeight = keyboardRectangle.height }
}

Source : https://stackoverflow.com/questions/31774006/how-to-get-height-of-keyboard | Last Update : Fri, 24 Jul 20

Answers related to get keyboard height swift

Code Explorer Popular Question For Swift