📜  快速获取键盘高度代码示例

📅  最后修改于: 2022-03-11 15:00:57.878000             🧑  作者: Mango

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