Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stinsen + IQKeyboardManager Navigation Bar issue #19

Closed
savage7 opened this issue Sep 2, 2021 · 1 comment
Closed

Stinsen + IQKeyboardManager Navigation Bar issue #19

savage7 opened this issue Sep 2, 2021 · 1 comment

Comments

@savage7
Copy link
Contributor

savage7 commented Sep 2, 2021

Hi 馃槉

I have a chat like screen within a NavigationCoordinatable with a TextField on the bottom. When I press the TextField the screen should move up. We use IQKeyboardManager for general TextField handling.

With Stinsen the NavigationBar is moved outside the Screen:
Simulator Screen Shot - iPhone 12 - 2021-09-02 at 07 32 13

If should look like this:
Simulator Screen Shot - iPhone 12 - 2021-09-02 at 07 32 00

I think I already found the root cause:
NavigationViewCoordinatorView sets StackNavigationViewStyle. When I remove this,
it looks as expected.

It tried to set the style directly to DefaultNavigationViewStyle inside the View but thats overruled by the NavigationViewCoordinatorView style.

Is there a proper workaround for this? (I've found none)
Why is StackNavigationViewStyle used explicitly? Can we make that somehow configurable or is StackNavigationViewStyle needed?

I modified the example app to show the problem. I've modified the LoginScreen and added IQKeyboardManager.
Stinsen + IQKeyboardManager Issue.zip

Thanks ALOT for your help and ongoing work in this great project 馃 馃槃

@rundfunk47
Copy link
Owner

rundfunk47 commented Sep 2, 2021

Hi! Thanks for the kind words :) Older versions of Stinsen did not use StackNavigation, but what I found was that it made the code really confusing because it needed to account for what I assume are bugs in SwiftUI, which Stack does not have. The bugs are not fixed in latest beta iOS either. Even when having those workarounds it didn't really work well. It was a long time ago but I think it had to do with isActive only worked correcly on the first and last view (master and detail), which makes dismissing coordinators not to work if you for instance run the testbed and push screen/screen/coordinator/screen/screen and try to dismiss the coordinator you pushed (since SwiftUI thinks that screen is not active, even though it very much still exists in the navigation).

@savage7 savage7 closed this as completed Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants