Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Open keyboard animation #48

Closed
Sundin opened this issue Sep 19, 2016 · 5 comments
Closed

Open keyboard animation #48

Sundin opened this issue Sep 19, 2016 · 5 comments

Comments

@Sundin
Copy link

Sundin commented Sep 19, 2016

When opening the keyboard, the height of the tableview containing the messages seems to change without animating. This causes the behaviour seen in the gif below (here with slow animations enabled).

ezgif com-optimize

@DavidSchechter
Copy link
Contributor

@Sundin I see the issue you are talking about.
I don't know currently how to fix it. The tableview size is being changed by the iOS when I update a constraint on the input view.
It could be a bug in iOS.
If we move the scrolling to the commotion block of the animation than it goes away, so it could be cause both animation are happing at the same time, and the scrolling is showing the old height while it's updating.
If more people open bugs like this ones, we will look more into it, as this is only visible when recording the screen in slow motion.

A potential fix would be to change this:

UIView.animate(withDuration: duration,
                                       delay: TimeInterval(0),
                                       options: animationCurve,
                                       animations: { self.view.layoutIfNeeded()
                                        if self.isKeyboardIsShown {
                                            self.messengerView.scrollToLastMessage(true)
                                        }
                },
                                       completion: nil)
        }

To have the option of either scrolling during the animation or in the completion block, depending on a flag set during init.

@Sundin
Copy link
Author

Sundin commented Sep 20, 2016

Hello and thanks for your quick reply!

While this effect is more significant in slow motion, it is still present as a disturbing flicker while running the app in real-time (see the gif below).

ezgif com-resize

@arneson
Copy link

arneson commented Sep 27, 2016

I am also having this issue, does not look very good when the last messages flicker.
Do you have any idea what could be the issue? I tried looking at it, it feels like it's just an animation missing somewhere? Maybe animate the change of the table view height? @DavidSchechter 🤔

@DavidSchechter
Copy link
Contributor

I have a fix for this issue. However, I cannot merge it because of issues with #42. Once those are resolved I will merged a fix for this issue.

DavidSchechter pushed a commit to DavidSchechter/NMessenger that referenced this issue Sep 29, 2016
Removed cocoapods related things (+3 squashed commits)
Squashed commits:
[e623b35] Fix for issue eBay#49
[dbf3b77] Fixes for issue eBay#48
[0371ded] Update project settings
DavidSchechter added a commit that referenced this issue Sep 29, 2016
@DavidSchechter
Copy link
Contributor

Fixed in #53

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants