Questions tagged [ios-navigationview]
66 questions
18
votes
3 answers
Is onAppear and onDisappear in a NavigationView of a SwiftUI app behaving as expected?
I would like to know if the behavior of onAppear and onDisappear in SwiftUI (Xcode 11 beta 6 when I wrote this) is what a developer would find more useful or it is just being more a problem than a feature.
Right now, if we use a cascaded navigation…

jpelayo
- 403
- 1
- 5
- 13
10
votes
3 answers
Remove the text from back button in SwiftUI
In short, I want to do this, but with SwiftUI.
(Home should be removed)
So far, I have not found a way to access the NavigationBarButton directly, and have managed to find the following that appears to be the only way I can find to date for…

CodeBender
- 35,668
- 12
- 125
- 132
9
votes
2 answers
Why does SwiftUI automatically navigate backwards when my underlying data source is updated and how can I avoid this behavior?
I have a fairly common set up:
A list of items created using the ForEach component
When an item is tapped my app navigates to a detailed view
Inside of the detailed view, the user can perform updates that change the underlying item
The problem is…

Robert
- 981
- 1
- 15
- 24
9
votes
3 answers
Deep programmatic SwiftUI NavigationView navigation
I'm trying to get a deep nested programmatic navigation stack in order. The following code works as expected when navigation is done by hand (ie: pressing the links). When you press the Set Nav button the navigation stack does change - but not as…

Andrew Lipscomb
- 936
- 8
- 19
8
votes
5 answers
SwiftUI how to set image for NavigationBar titleView like in UIKit?
I want to set an image in the titleView of NavigationBar in SwiftUI, as we do in UIKit
navigationItem.titleView = UIImageView(image: UIImage(named: "logo"))
this is how we do it in UIKit.
anyone know how to do it?

Zeeshan Ahmed
- 834
- 8
- 13
8
votes
1 answer
NavigationView doesn't display correctly when using TabView in SwiftUI
Hello everyone. I'm developing a simple SwiftUI application that displays some tweets. It has a tab view with two views: the main page that will display the tweets and a secondary view.
The problem is that the main page has a NavigationView. If I…

amodrono
- 1,900
- 4
- 24
- 45
7
votes
2 answers
How to get rid of space in nested NavigationView with SwiftUI
Im currently working on a project for iOS using SwiftUI. I have 3 pages (MainMenu, CalendarList, and DateDetails.)
On the 2nd page (CalenderList) there is an empty space between the top of the screen and the actual NavigationBarTitle.
on the third…

devmax
- 413
- 1
- 5
- 5
7
votes
2 answers
SwiftUI: How to switch to a new navigation stack with NavigationViews
I am currently using SwiftUI Beta 5. I have a workflow which involves navigating through a series of views. The last view involves an operation which populates a load of data into the app and ends that particular workflow.
Once the data has been…

Andy Thomas
- 1,367
- 2
- 14
- 30
6
votes
1 answer
SwiftUI - Pop back in navigation stack does not deallocate a view
I would like to start by highlighting my views hierarchy. I just have FindUserView and WelcomeView.
FindUserView is used for retrieving users from the server if the entered email exists. If so, then it automatically redirects me to the next…

Matrosov Oleksandr
- 25,505
- 44
- 151
- 277
6
votes
2 answers
SwiftUI NavigationLink immediately navigates back
I am using SwiftUI to create NavigationLinks from rows to detail views in a NavigationView (similar to what is being done in the tutorial https://developer.apple.com/tutorials/swiftui/building-lists-and-navigation). However, when I test in my app,…

bioround
- 375
- 2
- 12
4
votes
1 answer
NavigationLink tag and selection not working as expected
I am probably missing something but I can't make the NavigationLink work inside a List.
I'm using NavigationLink(destination, tag, selection) And i would like to pop to the root view with a tap on a button as you can see in this sample…

DanielZanchi
- 2,708
- 1
- 25
- 37
4
votes
0 answers
SwiftUI Open view deep in NavigationView from push notification
I want to open a view after taping on a push notification. The views and notifications are all working fine but my problem is when I try to open the view from the push notification via .sheet(isPresented) it is always presenting the view as modal.
I…

Max B
- 193
- 1
- 15
4
votes
1 answer
In SwiftUI, the application freeze without any warning when slide back halfway but released before completion
The following code reproduced the error:
import SwiftUI
struct ContentView: View {
@State private var number: Int = 5
var body: some View {
NavigationView() {
VStack(spacing: 20) {
…

Boom PT
- 374
- 4
- 11
4
votes
0 answers
How to stop an observedObject from updating the UI in SwiftUi?
I am working with a navigationView with swiftUI.
My problem is whenever I go to another view with a Navlink and the observedObject of
the root of my navigationView changes, my interface come back to the root view also.
So my question is : Is there…

sofiane_dv
- 71
- 7
4
votes
2 answers
How to incorporate a UISearchController into SwiftUI NavigationView by using UINavigationController's searchController property?
I am trying to create a SwiftUI view where I have a NavigationView that wraps a custom MapView (which wraps MKMapView), but, with very minimal success, I cannot seem to integrate a search controller into the NavigationView, unlike how you would…

bryan-vh
- 151
- 1
- 9