keyboard show hide notification
2019-06-20 本文已影响0人
轻云绿原
引入
pod PPFKeyboardNotification
使用
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
PPFKeyboardNotification.share.addObserver()
PPFKeyboardNotification.share.delegate = self
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
PPFKeyboardNotification.share.removeObserver()
}
// MARK: - PPFKeyboardNotification_delegate
extension ViewController:PPFKeyboardNotification_delegate {
func keyboardWillShowWithModul(modul: PPFKeyboardNotification, rect: CGRect, duration: Double, animationOption: UIView.AnimationOptions) {
print("键盘将要显示")
}
func keyboardWillHideWithModul(modul: PPFKeyboardNotification, rect: CGRect, duration: Double, animationOption: UIView.AnimationOptions) {
print("键盘将要隐藏")
}
}