Facebook and keyboard animation management
Asked Answered
S

1

8

Does anyone know how to implement composerBar and keyboard appearing like in Facebook messenger?

After scrolling tableView up, a keyboard appears from bottom smoothly and without any jumps . In my similar implementation it works like this: after scrolling up, when tableView bottom offset < 0, composerBar's input text field become first responder and keyboard jumps to finger. Yes, I use UIScrollViewKeyboardDismissModeInteractive.

How does Facebook implement this smooth animation?

keyboard

Edit: I try to explain how it works in Facebook Messenger, step by step.

I have InputAccessoryView on my viewController (TableViewController). Then I start to scroll TV up (pic 1)

enter image description here

Then, if bottom inset become more then some value (for example 10) (pic 2), I set firstResponder to inputTextField (pic 3)

enter image description here enter image description here

So, in common case, with 'UIScrollViewKeyboardDismissModeInteractive', keyboard jumps to finger position (pic 4) enter image description here

BUT! In Facebook Messenger keyboard drags from bottom with distance equal to distance traveled by the finger. (pic 5)

enter image description here

So, facebook messenger somehow control keyboard moving. Question is: how??

Salas answered 29/6, 2015 at 17:51 Comment(8)
check this out github.com/oseparovic/MessageComposerViewGiannini
or you can try this also github.com/jmascia/DAKeyboardControlGiannini
@eddwinpaz I tried, as I think, all of this frameworks, but no one can recreate such functionality.Salas
I know what you mean now.. you mean this github.com/jakubknejzlik/GNKeyboardAwareScrollViewGiannini
Thanks, but - nope. It's just scrollview insets adaptation to open/close keyboard. I also implement such feature in my messenger. To understand what i mean - just install FB messenger and try to scroll up any dialog TableView.Salas
Did you ever figure this out?Surtax
@simme Nope. After many attempts I just leave it :(Salas
Did you have any solution?Patiencepatient
O
0

What you are looking for is the Input Accessory View

It is a property of UITextView/UITextField that allows you to set a custom view that will be displayed above system keyboard.

Outlaw answered 29/6, 2015 at 23:25 Comment(1)
I use it too, thanks. But main question is - how to drag keyboard from bottom corner without any corrupted animations and jumps to finger position.Salas

© 2022 - 2024 — McMap. All rights reserved.