nickffox / KeyboardObserving

⌨️A Combine-based way to observe and adjust for Keyboard notifications in SwiftUI
MIT License
482 stars 36 forks source link

Replaced implicit animation modifiers with explicit animation ('withA… #13

Closed omroz closed 4 years ago

omroz commented 4 years ago

Replaced implicit animation modifiers with explicit animation ('withAnimation'), in order to animate all the affected views returned in the content view, thus preventing non-keyboard animation to stuck. (Attached sample project) KeyboardObservingSample.zip

nickffox commented 4 years ago

Thank you for this PR! I’ll do some testing this weekend and get this merged.

nickffox commented 4 years ago

Hey @omroz!

Can you help me understand the problem you're trying to solve this this PR? Based on my testing with Xcode 11.3.1 with an iOS 13.3 simulator, it seems like this change breaks makes views in a KeyboardObservingView jump to their destination without any.

With This Change Before this Change
kbo_withAnimation kbo_current
omroz commented 4 years ago

Hey Nick,

The problem that I had was related to the animation of the “test" button above the keyboard, once I clicked it. Before the change - the button wouldn't be animated and only the first frame would appear. After the change - the button was fully animated with scaling effects of 3 white dots.

Before the Change After the Change

Unfortunately, I missed the part where the keyboard animation would be affected by this change as well.

nickffox commented 4 years ago

@omroz do you plan to address the keyboard animation issue? Otherwise I'm going to close this PR for now.

omroz commented 4 years ago

Currently, I can't find a reasonable solution that could give an answer for both animations (keyboard + content view), therefore I'm closing this PR and I'll upload a new one once I'll figure that out. Thanks