美文网首页
keyboard show hide notification

keyboard show hide notification

作者: 轻云绿原 | 来源:发表于2019-06-20 14:37 被阅读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("键盘将要隐藏")
        }
    }
    

    相关文章

      网友评论

          本文标题:keyboard show hide notification

          本文链接:https://www.haomeiwen.com/subject/mljfqctx.html