-
Notifications
You must be signed in to change notification settings - Fork 87
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigation bar #2
Comments
Hi @mp3il, thank you. Let's create a generic building block called
Basically every screen of your app has to be an
Note that
This is the complete example:
The result is: Of course, you can customise the back button part as you wish, I just created a very simple example. |
Wow, Thanks so much! I learn so much from this project and also this example. btw, What I've ended done doing was a few modifications to your project so I can access the nav view model from the parent view, so I can push views from the parent and not just from the child views (that have access to the environment object) It's a bit hacky, though, but it allows me to push views not from within subviews of the NavigationStack So I do use the NavigationView, with only a container view that has a NavigationStack, which is exposing its navViewModel. Though I wasn't able to think about a cleaner way to expose a Singleton of the NavigationStack, maybe it will require creating the ViewModel and injecting it to the actual view? Thanks again! |
If you want you can point me to your fork and I'll take a look to see if I can give you some more specific hints. Anyway: if you turned the
This way you will have a navigation stack accessible from everywhere (from the inside and from the outside of the |
I'd also be interested in using this with a navigation bar. Was about to completely switch to using this in my project until finding out it didn't support nav bars out-of-the-box. Regardless, thanks a bunch for project! |
+1 for navigation. Forward and backward would be awesome. Gestures would be ++ |
Hi, I've been having a lot of issues with navigation in SwiftUI, basically when used Published vars trying to control navigation 🙄 When pushing a second view the binder var for previous pushed one was set to false by system ... it must babe something with navigation views. |
I've been able to combine NavigationStackView with NavigationView to use a native navigation bar. See the example in the readme in PR #44 |
I can't find an example on how to use the navigation bar in the readme. Tried the old NavigationView way, but doesn't seem to work. Cheers |
Unfortunately it's useless without support to Navigation Bar. |
Hi!
This is some impressive work! Thanks for that!
We are really facing lots of issues with the NavigationView comes with SwiftUI and looking for an alternative, the problem is that we do need the option to add a "Back" button to views, similar to the way native NavigationView let you.
Is there any example of how to do so? or maybe while using another library that provides a drop-in bar?
Thanks again!
The text was updated successfully, but these errors were encountered: