📜  如何获得键盘 xcode 的高度 - 任何代码示例

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

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