keyboard show hide notification

2019-06-20  本文已影响0人  轻云绿原

GitHub

引入

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("键盘将要隐藏")
    }
}
上一篇下一篇

猜你喜欢

热点阅读