Vij*_*har 4 notifications uikeyboard ios swift
如何删除键盘通知?
我把观察者放在键盘上打开和关闭。
我根据键盘是打开还是关闭来更改视图大小。
试试这个来删除键盘打开显示观察者,
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)
Run Code Online (Sandbox Code Playgroud)
您应该根据您的要求在deinitOr 中删除观察者viewDidDisappear。
| 归档时间: |
|
| 查看次数: |
1085 次 |
| 最近记录: |