For questions about SwiftUI's NavigationStack
, a view that displays a root view and enables you to present additional views over the root view.
Questions tagged [swiftui-navigationstack]
198 questions
1
vote
3 answers
SwiftUI NavigationLink isActive Binding Not Updated/Working
I have the following:
@State private var showNext = false
...
NavigationStack {
VStack {
NavigationLink(destination: NextView(showSelf: $showNext),
isActive: $showNext) { EmptyView() }
…

meaning-matters
- 21,929
- 10
- 82
- 142
1
vote
1 answer
How to popToRoot with the new iOS 16 NavigationStack inside a TabView?
I would like to be able to popToRoot from my first tabItem (when im on page2 (from first tabItem) and tap twice on first tabItem when im on second tabItem) without having to use the NavigationViewKit package and only the new NavigationStack, is that…

Flincorp
- 751
- 9
- 22
1
vote
0 answers
SwiftUI appear transition doesn't work inside NavigationStack
When I tap on an item in a list, I'd like to transition a view in from the leading edge.
Currently:
When I use ListView by itself, the appear transition works fine.
When I wrap ListView in a NavigationStack, the Image's appear transition does not…

Joshua Breeden
- 1,844
- 1
- 16
- 29
1
vote
1 answer
NavigationStack in combination with a TabView (SwiftUI, iOS16)
What is the correct way to combine the mentioned views.
As of now, i have a NavigationStack at the bottom of my app. It displays a LaunchView as root. When a user is authenticated, the main view is added to the stack, if not, the login/ register…

lr058
- 273
- 2
- 11
0
votes
1 answer
Swiftui Menu with NavigationLink using an overall NavigationStack
I've read all previous posts on this topic but none seem to address what I'm seeing for iOS 16 and using NavigationStack. I'm also using an overall @EnvironmentObject for navigation state.
I have a split view app. In the detail section, I have a…

Janene Pappas
- 1,366
- 12
- 26
0
votes
0 answers
How to do programmatic navigation in swiftui using navigationstack once state changes?
struct LoginView: View {
@State var isUserLoggedIn = false
NavigationStack{
//.....
Button {
Task{
await viewModel.doLogin(email: email, password: password)
}
…

Chup bae
- 69
- 1
- 7
0
votes
0 answers
SwiftUI: Using FocusState in NavigationView doesn't dismiss the keyboard properly
While implementing a SwiftUI only application I'm using NavigationView for iOS 15 / NavigationStack for iOS 16, Keyboard doesn't dismiss properly under different conditions
When using NavigationView + FocusState and running on iOS 15 phone it works…

Vortex
- 11
- 2
0
votes
1 answer
In SwiftUI how do I push a DetailView in a NavView when adding a new item to a List?
It seems so weird that I couldn't find anything. Isn't this a common problem?
So, I have a list in a NavigationView/-Stack and have a .toolbar add button.
When tapping that button it should open a DetailView as a navigation detail view (not a…

Emily Axford
- 3
- 2
0
votes
1 answer
How to center views vertically as if there were no navigation title?
I have a NavigationStack/NavigationView which loads its links. When it's loading or contains no links, I want to display a view centered in the screen to inform the user.
However, when there's a navigation title (.navigationTitle()), it takes space…

David
- 5
- 4
0
votes
2 answers
SwiftUI - How to programatically load a new view from the current view
My App requires an initial view to be loaded programatically and not via the TabView. Here is an MRE to show the problem. The sequence is:
ContentView loads the TabMenu
The initial TabMenu View is OneView
From the tabs you can switch between…

Edward Hasted
- 3,201
- 8
- 30
- 48
0
votes
0 answers
Programmatic selection of list item using the new navigationDestination API
I was wondering if anybody could help with achieving the following using the new navigationDestination API. Currently, I am creating a CoreData entity within a child view (AddEventsView) and then opening the recently created entity by passing the id…

Alex Capaldo
- 3
- 3
0
votes
0 answers
How to change destination on condition?
I am currently refactoring my navigation system from NavigationView to the new NavigationStack and I have a view in which if the user presses a button and has a certain device (i.e iPhone SE) then it redirects him to a specific view, and if he…

younes alaoui
- 79
- 7
0
votes
2 answers
SwiftUI PhotosPicker - AXRuntimeError and detached view controller warning
I have the following code in a View that I show via a NavigationStack path.push() statement:
@State private var avatarItem: PhotosPickerItem?
@State private var avatarImage: Image?
var body: some View {
VStack(alignment: .center) {
…

Janene Pappas
- 1,366
- 12
- 26
0
votes
0 answers
How to fix Update NavigationAuthority bound path tried to update multiple times per frame
For navigation I am using the iOS 16 NavigationStack API. I keep my NavigationPath instance inside my view models as @Published instead of in the views with @State. When navigating between the different screen I get this output message Update…

pineapple
- 1
- 1
- 2
0
votes
0 answers
SwiftUI, prevent the subview to inherit parent's animation
I've been playing with the NavigationPath for some time. I first figured that when a view is inserted into the path (full code is on this answer), the inserted page doesn't have standard navigation transition animation so, I've decided to force one…

kelalaka
- 5,064
- 5
- 27
- 44