You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When targeting iOS 16 and above, the use of NavigationView is deprecated (since iOS 16.2 and similar). Stinsen internally uses NavigationView (in its NavigationViewCoordinator) in combination NavigationLink for navigation.
This implementation detail came up as an issue in a custom ViewWrapperCoordinator that was doing if #available checks for iOS 16 and then using SwiftUI's NavigationStack instead.
Environment
iOS 16.2 / Xcode 14.2
Stinsen 2.0.13
Problematic behaviour
The problem is that the dismissal of views and coordinators is broken with the approach described above. Inconsistent behaviour and white screens are symptoms. The console also frequently shows the warning: NavigationLink presenting a value must appear inside a NavigationContent-based NavigationView. Link will be disabled..
Presentation of views and coordinators actually works just fine, as far as I can tell.
Proposed changes
I know Stinsen strives to be backward very compatible. Coming from iOS 13, there is a long way until the minimum supported version will be iOS 16. Even then, NavigationView still works the same as in previous versions of iOS.
However, it would still benefit users if there was support for the new navigation types, as it would make integrating more current implementations much easier and familiar going forward.
As NavigationView is still widely used, there could be an option to either use the old or new version.
At the very least it would be very helpful if there was a hint (e.g. in the README) that custom ViewWrapperCoordinators for stack-based navigation should use NavigationView instead of NavigationStack.
Let me know what direction you would prefer and if I could be of any help.
The text was updated successfully, but these errors were encountered:
sgade
changed the title
SwiftUI 4 compatibility and the use of NavigationStack
Issues caused by use of SwiftUI's NavigationStack
Jan 11, 2023
Thanks for the quick reply and for referring to the existing discussion. I didn't expect the topic to be in the comments to that issue but now I read it.
Are there any updates on the topic?
I think the suggested Backport solution might make it somewhat manageable to keep both implementations around for the foreseeable future.
Also, do you want to keep tracking the progress in the other ticket? Then I'll close this one.
When targeting iOS 16 and above, the use of
NavigationView
is deprecated (since iOS 16.2 and similar). Stinsen internally usesNavigationView
(in itsNavigationViewCoordinator
) in combinationNavigationLink
for navigation.This implementation detail came up as an issue in a custom
ViewWrapperCoordinator
that was doingif #available
checks for iOS 16 and then using SwiftUI'sNavigationStack
instead.Environment
Problematic behaviour
The problem is that the dismissal of views and coordinators is broken with the approach described above. Inconsistent behaviour and white screens are symptoms. The console also frequently shows the warning:
NavigationLink presenting a value must appear inside a NavigationContent-based NavigationView. Link will be disabled.
.Presentation of views and coordinators actually works just fine, as far as I can tell.
Proposed changes
I know Stinsen strives to be backward very compatible. Coming from iOS 13, there is a long way until the minimum supported version will be iOS 16. Even then,
NavigationView
still works the same as in previous versions of iOS.However, it would still benefit users if there was support for the new navigation types, as it would make integrating more current implementations much easier and familiar going forward.
As
NavigationView
is still widely used, there could be an option to either use the old or new version.At the very least it would be very helpful if there was a hint (e.g. in the README) that custom
ViewWrapperCoordinator
s for stack-based navigation should useNavigationView
instead ofNavigationStack
.Let me know what direction you would prefer and if I could be of any help.
The text was updated successfully, but these errors were encountered: