Questions tagged [ios-navigationview]
66 questions
1
vote
0 answers
SwiftUI: What is an alternative to using onAppear?
I want to load health data so that when the tab is tapped a users steps are displayed once. But by using onAppear, every time the tab is tapped it loads the steps again and displays them twice. I believe this is due to the onAppear. What alternative…

Mxyb
- 83
- 1
- 9
1
vote
0 answers
Is it possible to replace the default back button and sidebar icon in iPad's Navigation Bar using NavigationView in SwiftUI?
I'm trying to make an iOS app that uses SwiftUI's NavigationView to build a side menu.
On iPhone it works perfectly, but on iPad I cannot get Rid of the Sidebar button and the back button text and icon. I would like to replace those buttons with the…

Valerio Ventucci
- 77
- 6
1
vote
1 answer
SwiftUI - Navigation View opening with Back button and half grey screen / weird behavior
I am trying to add navigation view to my app, but it is causing issues. My main UI is an infinitely swipe-able carousel of pages. It originally looks like this:
Then when I wrap it in a navigation view, it opens like this, with a back button and…

adam.code
- 73
- 9
1
vote
1 answer
Push UIViewController from SwiftUI with UINavigation with Back Button?
I need to open UIViewController from SwiftUI with UINavigation having back button.
Currently, I had implemented this via ViewControllerRepresentable and NavigationLink, its works, but I have two Navigations SwiftUI(NavigationLink with back button)…

Bumaza
- 103
- 1
- 5
1
vote
1 answer
Double List in NavigationView [Swift]
I'm trying to fit two categories of an item on two different list, named 'Wide-Field' and 'Deep-Sky', however I want the second list to be below the first.
I was expecting it to look something like this:
However, instead it splits the screen in…

Alex Hammond
- 35
- 6
1
vote
1 answer
SwiftUI Navigation Controller stuttering with two Navigationlinks per List row
I am trying to create two NavigationLinks in a repeating List. Each has a separate destination. The code all works fine until I imbed the call to the root view in a List/ForEach loop. At which point the navigation becomes very strange.
Try to…

cdeerinck
- 688
- 6
- 17
1
vote
1 answer
Maintain navigation item button alignment in SwiftUI as second button is added & removed
I have a scenario where there will be one or two trailing buttons based upon some criteria. I would like to have it such that the buttons always align to trailing for visual consistency, but so far, they appear to center align, regardless of what I…

CodeBender
- 35,668
- 12
- 125
- 132
1
vote
0 answers
SwiftUI List crashes when deleting an item that was tapped before
I have a List with Recipes in a NavigationView that navigate to the RecipeDetail, with is just a Detail View of the recipe. The List is declared like this:
NavigationView{
List {
Section(header: HStack {
…

Moritz Schaub
- 91
- 1
- 9
1
vote
1 answer
SwiftUI - NavigationView's navigation bar with rounded corner and shadow
I am using SwiftUI for my iOS (13+) application. The requirement is to have the bottom of the SwiftUI NavigationView's navigation bar rounded and shadowed. Like this:
Navigation Bar with rounded bottom and shadow
There is a similar post regarding…

kinhong
- 36
- 1
- 1
- 4
1
vote
1 answer
SwiftUI HStack won't move to the very top?
I have an Hstack with two components. One is a drop-down menu, and the other is a nav link to "forgot password" page. I can't figure out why it won't go all the way to the top of the page.
I've tried inserting Spacer() on the very bottom (but…

aloogobitings
- 31
- 3
1
vote
1 answer
ObservedObject not working on NavigationLink's destination if there are updates on parent
I have two screens, a master and a detail, detail has an ObservedObject that has it's state. I also want to hide the navigation bar on master and show it on detail. To do that, I have the navigation bar hidden status as a @State property on master…

Daniel Amarante
- 749
- 5
- 15
1
vote
3 answers
SwiftUI Navigation Bar doesn't disappear
I have a NavigationView where I set the .navigationBarHidden(true) in my SplashScreen. Here it correctly does not display, however when I go to the next screen the NavigationView bar appears. How can i properly hide the navigation bar? The…

Adrian Le Roy Devezin
- 672
- 1
- 13
- 41
1
vote
0 answers
SwiftUI NavigationView show master on left
I have some master detail in Swift UI. Here it is:
import SwiftUI
struct MenuItemView: View {
var title: String
@Environment(\.presentationMode) var presentationMode
private var btnBack : some View { Button(action: {
//if…

sergiy batsevych
- 365
- 3
- 9
1
vote
0 answers
Encountering unexpected behavior when List rotates with SwiftUI
I have setup a relatively basic List embedded in a NavigationView, but when I perform a rotation, things do not work as expected.
The following screenshots show the sequence of events.
When the view is initially presented on an iPhone (running iOS…

CodeBender
- 35,668
- 12
- 125
- 132
0
votes
0 answers
swiftUI navigation doesn't work when @state object changes the value
I've created modular architecture and I want all my features will be separate modules.
I want navigation also handles independently, but I am facing a problem to handle it.
Let's assume I have LoginScreen, RegisterScreen, and ProfileScreen.
I can…

fish40
- 5,738
- 17
- 50
- 69