I am using onDrag functionality to hide keyboard in iOS chat view controller. The problem is I can't get the scroll value when dragging keyboard to hide (I need exactly like whats app messenger keyboard dismiss by using swiping keyboard).
So, I used
NotificationCenter.default.addObserver(self, selector: #selector(keypadWillChange(_:)), name: UIResponder.keyboardDidChangeFrameNotification, object: nil)
Selector,
@objc func keypadWillChange(_ notification: Notification) {
print("Dragging...")
}
When I drag the function keypadWillChange
is not called. Any other alternatives to solve this problem?
Thanks in advance...
If you are using UITableView
, in UIStoryboard
do the following.
Attribute Inspector
. UIScrollView
section, there is a keyboard settings item.WhatsApp
keyboard.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.