I am trying to use the UITableView.keyboardDismissMode = UIScrollViewKeyboardDismissMode.Interactive
, to be able to drag my keyboard up and down. However I can't find any way to track the keyboard frame to update my tableView frame and messaging view. I am simply trying to replicate the standard iMessage behaviour. Given the name, I would have thought that UIKeyboardWillChangeFrameNotification
would have been perfect for tracking the keyboard frame changes, but it only notifies when the gesture ends and the keyboard animates up or down.
Asked
Active
Viewed 1,421 times
16
![](../../users/profiles/1033581.webp)
Cœur
- 32,421
- 21
- 173
- 232
![](../../users/profiles/4337311.webp)
TimWhiting
- 2,207
- 4
- 18
- 37
-
FYI: http://www.openradar.me/14847817 – Yuval Tal May 22 '17 at 17:51
-
any one find solution ? – kirti Chavda Apr 15 '21 at 13:23
2 Answers
2
I'm not sure if this will work but you could try to track the drag progress via the panGesture
property on UIScrollView
in your tableView. It wouldn't be a direct tracking of the keyboard frame, but if you know the keyboard's height and the progress/offset of the pan, you might be able to math your way around the problem.
![](../../users/profiles/4454304.webp)
richiereitz
- 163
- 9
-3
The best approach for interactive dismissal is to use the "UIKeyboardDidShowNotification" and "UIKeyboardWillHideNotification" system notifications. When the selector is called you update the table's bottom inset. NOT the constraints. Updating the inset will give you a beautiful smooth keyboard dismissal experience.
![](../../users/profiles/3073499.webp)
Cătălin
- 13
- 4