Questions tagged [swiftui-navigationstack]

For questions about SwiftUI's NavigationStack, a view that displays a root view and enables you to present additional views over the root view.

198 questions
0
votes
0 answers

path.removeLast() throws EXC_BAD_INSTRUCTION

I have NavigationStack with NavigationPath: ... @State var path = NavigationPath() ... var body: some View { NavigationStack(path: $path) { VStack() { MyView() { path.append("Edit") } …
ArisRS
  • 1,362
  • 2
  • 19
  • 41
0
votes
1 answer

SwiftUI NavigationStack Programmatic - Dismiss Multiple Views

Due to the horrible memory leaks when using NavigationPath() (initializing StateObjects numerous times, not releasing memory when views are removed from the stack, etc.), I am forced to use .navigationDestination(isPresented: $blah, destination {…
kittonian
  • 1,020
  • 10
  • 22
0
votes
1 answer

SwiftUI TextField mysteriously breaks navigation animation when used with NavigationPath

MRE enum HomeDestination: Int, CaseIterable, Hashable, Identifiable { case a var id: Int { rawValue } var name: String { switch self { case .a: return "A" } } } class NavCordinator: ObservableObject { …
erotsppa
  • 14,248
  • 33
  • 123
  • 181
0
votes
0 answers

NavigationDestination sliding transition not working

struct First_View: View { @State var secondViewShown = false var body: some View { NavigationStack { VStack { Text("Step 1") Button(action: { secondViewShown.toggle() }) { …
aali
  • 1
  • 2
0
votes
0 answers

SwiftUI - PopToRoot IOS 16

In the below code please let me know how to perform popToRoot like from the rewards view to menu view thats my root view , using the navigation stack and navigating through the navigation link & also suggest me how to change the navigation bar title…
0
votes
0 answers

NavigationSplitView detail not updating

Why does the button "Show second view" not work here? struct ContentView: View { @State private var showSecondView = false var body: some View { NavigationSplitView { // Sidebar content irrelevant } detail:…
0
votes
0 answers

Strange navigation with NavigationStack inside NavigationSplitView

Why does "Above NavigationStack" disappear when I click "Nav Link"? struct ContentView: View { var body: some View { NavigationSplitView { // Sidebar content irrelevant } detail: { Text("Above…
0
votes
1 answer

Show detail page default in iOS with SwiftUI

I want to show the detail page on opening the app with back button. On clicking the back button list of accounts should display. Just like the iOS default mail app. I'm using the NavigationStack, NavigationLink and .navigationDestinatiion Please…
0
votes
1 answer

SwiftUi NavigationLink opening multiple views at once

NavigationStack { TextField("Factor Name", text: $factName) .textFieldStyle(.roundedBorder) .padding() Picker("Factor Type:",…
0
votes
1 answer

Reusable view with NavigationStack and size of visible cells / SwiftUI / Swift 5

I was wondering if you could help me with a SwiftUI question. Specifically, I'm trying to create a reusable view that includes a NavigationStack with ForEach loop and has adjustable cells sizes. Can I make the size of NavigationStack to be dynamic…
Gucci
  • 47
  • 1
  • 7
0
votes
2 answers

SwiftUI: Displaying the navigation bar using NavigationStack

I want to display a navigation bar having an orange background color and a title with white color. Everything works fine with this setup: let navigationBarAppearance = UINavigationBarAppearance() navigationBarAppearance.titleTextAttributes =…
0
votes
2 answers

SwiftUI: NavigationLink Causing Freeze @ 99% Debug CPU

I am new to Swift and SwiftUI and working on an app that requires passing nested bindings through various views. I'm encountering an issue where a NavigationLink in a subview passing a binding to a child detail view causes the app to completely…
0
votes
1 answer

NavigationStack iOS16 with Route, how to pop back to root?

I have the following navigation stack using route to go to differnet views: import SwiftUI import FirebaseAuth import WebKit enum Route:String, Hashable { case linkSettings, linkWallet } struct Dashboard: View { @State private var…
0
votes
0 answers

use navigationDestination(isPresented: ) and .navigationDestination(for: data) together

I come across a strange navigation bug, this is my code: import SwiftUI struct TestNavView: View { @State var isPresented = false var body: some View { NavigationStack{ VStack{ VStack{ …
Rufus
  • 640
  • 1
  • 7
  • 14
0
votes
0 answers

Swiftui Navigation Stack not displayed bottom tabbar in child screen

When i am pushing from home to chat screen it wont showing me bottom tabbar i want to display it struct MainRouterView: View { var rootScreen:ScreensPath @ObservedObject var router: Router init(rootScreen:ScreensPath) { …