Questions tagged [swiftui-navigationview]

For questions about NavigationView - a view in Apple's SwiftUI framework that presents a stack of views representing a visible path in a navigation hierarchy. When using this tag also include the more generic [swiftui] tag where possible.

Links:

583 questions
1
vote
1 answer

How can I center the Navigation Title?

I have been trying this for a while but with everything I do, I don't get the desired result. To be clear, I don't want to use the inline display mode, I want a large title but centered. Here is what I'm trying to do: My best attempt was a toolbar…
Arnav Motwani
  • 707
  • 7
  • 26
1
vote
2 answers

How can I change the font and color of the Navigation Bar back button

I am trying to change the font and color of the Navigation Bar button. Ideally, I'd like to change it to black and use a custom font that I already have set up. Is there any way to modify the existing button? I tried this in my view's init for the…
Arnav Motwani
  • 707
  • 7
  • 26
1
vote
0 answers

SwiftUI Picker navigating to Core NavigationView instead of View that called it

I have been racking my brain trying to figure out what is causing this and I am assuming it has to do with where the NavigationView is located. To add context, I have a view that we will call View A which contains the NavigationView. In View A…
Livy M
  • 11
  • 3
1
vote
2 answers

Apply a navigationStyle based on horizontalSizeClass for the root NavigationView and preserve the navigation stack

On app launch, I want to get the horizontalSizeClass and based on if it's compact or regular, apply a navigation style to my root navigation view like so: import SwiftUI @main struct MyApp: App { @Environment(\.horizontalSizeClass) var…
alobaili
  • 761
  • 9
  • 23
1
vote
0 answers

Leaks in NavigationView/List/ForEach with Dynamically Generated Views

If you create a very simple example that shows a lot of leaking object within the SwiftUI code if you nest NavigationView/List/ForEach and return different types of views in the ForEach closure. import SwiftUI class MyStateObject : ObservableObject…
1
vote
0 answers

SwiftUI NavigationView with in-window blending on macOS

I'm trying to build UI similar to Maps.app in SwiftUI for macOS. I'm having trouble to apply in-window blending mode for toolbar and sidebar. The code for the app is roughly this: struct ContentView: View { @State private var region =…
Priit
  • 5,200
  • 2
  • 21
  • 20
1
vote
1 answer

self.presentationMode.wrappedValue.dismiss() not working in SwiftUI

Here is the code of login page, navigate from tabview using navigation-link and here I want to pop back once get the api response, Also if any way to pop back using navigationLink same link push, please let me know. thanks in advance!! struct…
1
vote
1 answer

SwiftUI view's onAppear event call on swipe back gesture action

As you probably know, SwiftUI's .onAppear is called when the view appears. In my application, I have implemented a swipe back gesture from child to parent view. However, parent's onAppear is called when it is already partly visible when doing a…
liudasbar
  • 173
  • 4
  • 11
1
vote
0 answers

SwifUI, iOS 13 show view on top of Navigationview in destination view

I am working on app supporting iOS 13 using SwiftUI, I have custom activity indicator(UIViewRepresentable) on which is displayed on Api call In main screen where I have created NavigationView, on top of that I am able to add the activity indicator…
1
vote
0 answers

Custom back button destination SwiftUI

I have a deeply nested View, and I want the back button to take the user all the way back up to one of the views which is quite near the root, instead of to the parent. At the moment, in this View I have @Environment(\.presentationMode) var…
1
vote
3 answers

SwiftUI Clear Navigation Stack

In my iOS 14 SwiftUI app, when user is not logged in, I make him go through a few setup screens before presenting the main logged in screen. At the last setup screen, I use a NavigationLink to present the main logged in screen. How do I clear the…
1
vote
0 answers

SwiftUI: how to remove animation on NavigationLink

Is there a way to remove the animation in NavigationLink ? That would be particularly useful when using deep-linking/programmatic-navigation, via the isActive binding. Displaying the animation is that case feels inappropriate.
1
vote
1 answer

iOS | SWIFTUI | Buttons don't work in the HStack | How can I fix this, Is there a workaround.?

I have attempted and searched quite a bit of stackOverflow and other places while there are some questions similar, they tried to change the style of the button to Plain of Default, I tried those methods, they don't seem to work. For context, this…
1
vote
1 answer

SwiftUI preview looks different from the simulator

Can anybody tell me why my views looks fine in the preview, but get pushed down in the simulator? It's super simple and very little code so I honestly have no idea what's going on. Here is my code: import SwiftUI import FirebaseAuth struct…
1
vote
0 answers

How to navigate multiple screens with custom back button in swiftui

NavigationView{ VStack (spacing: -3){ UserImage() Spacer() VStack(spacing:50){ Version() VStack( spacing:25){ …