开发需求:对键盘弹出及隐藏事件进行监听
需要通过NotificationCenter对键盘事件进行监听
//键盘即将弹出
NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardShow(note:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
//键盘即将隐藏
NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardHidden(note:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil)