RxSwiftCommunity / RxKeyboard

Reactive Keyboard in iOS
MIT License
1.61k stars 175 forks source link

[Feature request] Using animation curves to prevent discontinuity #33

Closed sidmani closed 6 years ago

sidmani commented 7 years ago

UIView's default animation curve is different from UIKeyboard's curve, causing flicker/overlapping for views driven by RxKeyboard's visibleHeight when the keyboard is presented and dismissed. Additionally, in interactive dismiss mode, dragging down partially and then cancelling the dismiss causes the view to jump.
Here's the easiest way to fetch the curve from the notification: let keyboardCurve = UIViewAnimationCurve(rawValue: (userInfo.object(forKey: UIKeyboardAnimationCurveUserInfoKey) as! NSNumber)!.intValue)
I was playing around with the idea of somehow representing the curve as a function of time and sending out continuous values through an observable, but that's pretty complicated. Thoughts?

devxoul commented 7 years ago

Can you try:

UIView.animate(withDuration: 0) {
  // ...
}