378 questions
-1
votes
1
answer
72
views
How to reduce top padding of NavigationBar to match native Apple apps? [closed]
When I use navigationTitle in SwiftUI, the top padding becomes too large. However, in Apple’s own apps the top area is noticeably smaller and more compact. How can I achieve the same native look with ...
2
votes
1
answer
59
views
How to use NavigationStack with path and multiple enum type destinations in SwiftUI
I want to use NavigationStack with a custom navigation path array supporting multiple destination types. For example:
enum A: Hashable { ... }
enum B: Hashable { ... }
NavigationStack(path: $...
1
vote
1
answer
168
views
Concentric corners in a Navigation destination
I have this view with a GroupBox at the bottom. I apply the concentric clipShape and it looks great:
struct ContentView: View {
var body: some View {
VStack {
Spacer()
...
0
votes
2
answers
116
views
How to Eliminate Form Padding in NavigationStack
I have a form being loaded inside a navigation stack and I'm showing an image and title in the first form section with the code below:
Form {
Section {
VStack {
Image("...
1
vote
2
answers
130
views
NavigationStack causes multiple instances of ViewModel created due to View re-render
I am seeing multiple instances of my LoginViewModel in memory graph as NavigationStack re-renders / regenerates the view when path which is NavigationPath changes.
Below is the simplified / sample ...
0
votes
0
answers
57
views
How can I use navigationDestination for cross linking in a NavigationSplitView
I am writing a Universal App for macOS, iOS 26 and want to do a two column layout with NavigationSplitView.
In the sidebar I have two NavigationLinks with a value of NavigationOption, which are used ...
0
votes
0
answers
108
views
Is there any way to use a MapBox map in a SwiftUI NavigationStack without increasing memory with each new view?
I am trying to build an iOS app where user profiles have a map component to them. The recursive navigation in my NavigationStack is causing memory problems since every map I add to the stack adds ...
1
vote
0
answers
106
views
How can I fix the broken layout with a ScrollView inside a TabView that is inside a NavigationStack in SwiftUI?
I'd like to achieve a layout similar to the one shown in the Apple Fitness app. When I insert a ScrollView into a TabView, everything works fine, but if I try to add a NavigationStack to wrap the ...
1
vote
2
answers
146
views
Large navigation title scrolls with ScrollView, even if it should not
I have simple setup to reproduce this:
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
Rectangle()
...
1
vote
1
answer
318
views
ToolbarItem flickers when switching between tabs in iOS 26
How can I avoid the flickering ToolbarItem when switching between tabs, while still keeping a dedicated NavigationStack for each Tab?
I have unsuccessfully tried:
Nesting the TabView inside another ...
0
votes
0
answers
97
views
NavigationStack causes microhang when loading sheet
I have a simple sheet:
.sheet(isPresented: $newContactSheetTrigger) {
NewContactSheet()
.presentationDetents([.large])
}
with the following code:
import SwiftUI
import SwiftData
import ...
0
votes
1
answer
140
views
SwiftUI NavigationStack swipe anywhere on screen to go back
So by default on ios you can swipe from the edge of the screen to go back, and this question shows how to keep that while disabling the back button:
Hide navigation bar without losing swipe back ...
1
vote
3
answers
94
views
Multiple NavigationLinks in a List Trigger Simultaneously – How to Fix?
In SwiftUI, when I place multiple NavigationLink views directly inside a HStack, then put this HStack inside a List, clicking one link triggers all NavigationLink views, causing unexpected navigation ...
-1
votes
1
answer
153
views
SwiftUI sheet unexpectedly dismisses and navigates back after editing bound data in nested NavigationStack
I'm working on a SwiftUI app to manage recipes. I present a list of recipes in RecipesListView, and when the user taps on one, I navigate to a RecipeDetailView. Inside that detail view, I allow the ...
3
votes
5
answers
2k
views
ScrollViews at the bottom of NavigationStack cause the navigation title to be invisible in iOS 26
I have a NavigationStack that contains a ScrollView at the bottom of the screen.
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
...
0
votes
1
answer
57
views
SwiftUI Tab in navigation stack title
I'm targeting iOS18 and above, I'm trying to achieve this effect
The app displayed is Revolut, I want to create a similar effect but I can't seem to find a starting point I also need it to be in sync ...
0
votes
0
answers
73
views
Is there a possibility to change navigation bar title by changing view in NavigationStack?
I'm trying to change navigation bar title by tapping one of tabs in tabview. Is there a chance to do it?
Here's the code I'm using:
struct ContentView: View {
var body: some View {
...
2
votes
0
answers
141
views
`.navigationBarBackButtonHidden()` not working on iOS 18.4
Current situation
I've got a minimal reproducible example of DocumentGroup app using a NavigationSplitView with a DetailView. I want to completely remove the default Navigation Bar inside these views ...
0
votes
0
answers
35
views
SwiftUI: PlayerBarView Not Persisting Across Navigation in Nested Views
I'm working on a SwiftUI app where I have a PlayerBarView that should persist across different views, specifically within a ListeningContainerView that contains a ListeningView and navigates to a ...
0
votes
1
answer
111
views
SwiftUI Navigation Issue: Unable to Reset to Welcome Screen on Logout with Nested NavigationLinks
I'm building a SwiftUI app with Firebase Authentication and experiencing navigation issues when users log out. My app has the following structure:
A root view in App.swift that conditionally shows:
...
1
vote
0
answers
109
views
Hiding tab bar on iOS 18 when pushing screens with NavigationStack animation glitch
Given that on iPadOS 18 the TabBar is on the top, and I need to hide/show it based on push/pop a view to/from a NavigationStack I am experiencing a weird animation glitch.
This question is similar an ...
0
votes
1
answer
98
views
NavigationLink in swiftui and routing
first of all thanks for attention and your help, so...
in my app I have router from where I log and logout user
@main
struct JobMatchApp: App {
@StateObject private var vm = RouterViewModel()
...
0
votes
2
answers
360
views
NavigationStack inconsistent push animation with zoom navigation transition when back button hidden
In SwiftUI with attached code when i set navigationBarBackButtonHidden to true, the NavigationStack's navigation bar always pushes in when I dismiss the detail view. Since it's a zoom transition, I ...
4
votes
1
answer
316
views
Hiding new tab view in iOS 18 when pushing screens
With iOS 18 Apple decided to move our beloved bottom tab bar controller to the top of the screen (apparently thats more modern). I am having the following situation: I have TabView where we have root ...
0
votes
1
answer
263
views
SwiftUI TabView hidden tabbar navigation stack animation order issue
I am having the following view:
import SwiftUI
struct HiddenTabs: View {
var body: some View {
TabView {
NavigationStack {
NavigationLink("Tap Me") {...
0
votes
0
answers
43
views
Auto-Collapsing navigationTitle when using TabView w/ shared toolbar?
Suppose I have a TabView which is the root of my app. I need to be able to tab between each of these, but some of them have their own NavigationStack Every one of them has a List associated with them, ...
0
votes
0
answers
119
views
How to add custom back button with swipe to back gestures in SwiftUI
I want to add custom back button to my app with out losing swipe to back gestures.
Adding this
.navigationBarBackButtonHidden(true)
will remove swipe to back gestures
I tried adding below snippet to ...
0
votes
3
answers
204
views
show fullscreen view with overlay in SwiftUI?
I have 2 views:
import SwiftUI
struct SwiftUIView: View {
var body: some View {
NavigationStack {
... //show SwiftUIView2
}
.toolbar {
...
}...
1
vote
1
answer
123
views
How do some SwiftUI modifiers modify higher level views?
Most SwiftUI modifiers modify the views beneath them in the hierarchy, but some modifiers modify views above them in the hierarchy. In my example below .navigationTitle, .toolbar, and ....
1
vote
1
answer
86
views
How to make NavigationLink rows clear?
I am trying to make NavigationLink rows transparent in a List while using SwiftUIIntrospect to make the NavigationStack background clear. However, I am encountering an issue where the solution does ...
1
vote
1
answer
81
views
is it possible to get NavigationSplitView to work on iPhone when not on root view?
I have an app that utilizes NavigationSplitView on the next view that gets pushed onto the root view's NavigationStack (I don't like using a three column layout and prefer to have an entire screen for ...
0
votes
1
answer
310
views
Is there any advantage of using NavigationStack when working with .sheet or .fullScreenCover navigation?
After working with UIKit for several years I am still quite new to SwiftUI and especially to its navigation features.
Currently I am trying to get my head around NavigationStack and ....
1
vote
1
answer
140
views
iOS UITesting - How can I access the search bar in a NavigationStack for UI Testing?
How can I access the search bar within NavigationStack for UI Testing?
Code:
var body: some View {
NavigationStack {
List {
// some elements
}
}
.searchable(...
0
votes
1
answer
48
views
Back button misalignment in NavigationView/NavigationStack within a sheet after orientation change
I observed this issue and added feedback to the Apple Feedback Assistant. However, here is the problem:
When switching from portrait to landscape format and back, the back button in the navigation ...
0
votes
0
answers
36
views
Can't show Tab Bar with NavigationStack
I have 5 screens with Tab bar here is code:
struct BaseTabViewUI: View {
@StateObject var routerTask = RouterTask()
var body: some View {
TabView {
FeedUI()
.tabItem {
...
0
votes
1
answer
433
views
Navigation Issue in iOS 18: Duplication of Navigation Trigger When Using @Environment(\.dismiss) in SwiftUI
I’m encountering an issue with SwiftUI navigation in iOS 18, where navigating to a DetailView causes unexpected duplication of navigation behavior when @Environment(.dismiss) is used.
Code Example:
...
0
votes
1
answer
151
views
Issue Navigating to View from Side Menu in Swiftui
I am currently making a side menu for an iOS app in SwiftUI and having navigation issues. Navigating to a view from the side menu is fine, but the view will show up inside the side menu itself, rather ...
0
votes
1
answer
76
views
Passing @FocusState through Navigation
This is an interesting scenario. While I'm not going to get into designing the viewHandler, assume a parent view has NavigationStack setup where you can append to the navigationPath variable.
Let's ...
1
vote
1
answer
113
views
SwiftUI List/ScrollView x MapKit - Map adds gradient/material toolbar (navigation bar) and overrides its design
I'm working on iOS 17+ app in SwiftUI, which uses MapKit.
MapKit's Map view adds a gradient/material view on Toolbar, which is presented on second and every next navigation.
I would like to get the ...
1
vote
0
answers
51
views
Routing in NavigationStack not working as expected
I have a full code example below. The problem is that when I tap "Go to Detail" in the DogsView, the detail view is not visually pushed, although the path does get added to the path array ...
1
vote
0
answers
111
views
How to create a Navigation Bar with a title, "Done" button and Segmented Picker in SwiftUI?
I'm trying to replicate a UI similar to the one in the Safari app on iOS (as shown in the attached image) using SwiftUI. The navigation bar includes:
A dynamic title based on the selected segmented ...
0
votes
0
answers
63
views
Confused By NavigationStack Message and Navigation Behavior
I am getting a lot of odd behavior with NavigationStacks and NavigationSplitView and am unclear why.
There are several things going on, different depending on portrait or landscape.
The sample app has ...
0
votes
0
answers
153
views
How to Customize the Timing of NavigationBar Title Display in SwiftUI
I am looking for a way to customize the display timing of the navigation bar’s title in SwiftUI based on the content.
Specifically, I would like to control when the title appears or disappears as the ...
1
vote
1
answer
28
views
Fail to show bio in DetailView while using NavigationStack in SwiftUI
I am learning iOS development using SwiftUI. I pass my user to DetailView using NavigationStack :
let shape = RoundedRectangle(cornerRadius: Constants.cornerRadius)
NavigationStack {
...
0
votes
1
answer
208
views
How do I maintain a consistent toolbar across all child screens in a navigation stack?
I have added a toolbar to the root view of my navigation path and it disappears when I segue to the next screen in my path.
I have tried placing it as a modifier to the NavigationStack but then it ...
3
votes
1
answer
233
views
Difference Between navigationBarTitle and toolbarTitle in SwiftUI
What is the difference between ①navigationBarTitleDisplayMode and ②toolbarTitleDisplayMode when using them with SwiftUI’s navigationTitle?
It appears that .inlineLarge only works with the latter (②), ...
1
vote
1
answer
42
views
How to make a custom cell/row menu clickable (3 dots at top right) in a List with NavigationLink
I am trying to show popover when user click on custom cell/row menu in List. But every time the cell get the action and navigating to inside the details screen. Here is my code snippet. Also attached ...
3
votes
1
answer
855
views
Issue with Margin During Navigation Transition in iOS 18
The new .navigationTransition feature introduced in SwiftUI for iOS 18+ offers an impressive animated screen transition. However, during the transition, the parent view shrinks, leaving a white margin ...
0
votes
1
answer
49
views
How do I remove space between the navigation bar and the view?
I am getting a lot of unnecessary space between the navigation bar and the beginning of the FormContent view. I tried putting top padding of the FormContent as 0, but it didn't work. How do I remove ...
-1
votes
1
answer
495
views
Different navigationBarTitleDisplayMode behaviour between iOS 17 and iOS 18
I have this bottom sheet in my app I'm building for a tutorial (100 days of Swift UI), and I noticed that the exact same code for showing a bottom sheet with a title has different effects on iOS18 vs ...