Questions tagged [swiftui-navigationsplitview]

45 questions
9
votes
3 answers

SwiftUI - Nested links within NavigationStack inside a NavigationSplitView not working

I'm playing around with the new navigation API's offered in ipadOS16/macOS13, but having some trouble working out how to combine NavigationSplitView, NavigationStack and NavigationLink together on macOS 13 (Testing on a Macbook Pro M1). The same…
thiezn
  • 1,874
  • 1
  • 17
  • 24
8
votes
0 answers

NavigationTitle delay on iOS 16.1 when using NavigationSplitView

Is anyone else facing this issue with iOS 16.1 NavigationSplitView where the NavigationTitle loads after the view is loaded? – works fine on iOS 16.0. (https://i.stack.imgur.com/G0IUG.gif) It's literally the same code, but it's giving me issues…
5
votes
2 answers

How to run `task` or `onAppear` on NavigationSplitView detail for every selection change?

I'm trying to use NavigationSplitView with a DetailView that has a task or onAppear in it, but it seems it only runs once. enum MenuItem: String, Hashable, Identifiable, CaseIterable { case menu1 case menu2 case menu3 case menu4 …
ygee
  • 2,580
  • 3
  • 17
  • 21
5
votes
2 answers

SwiftUI 4: navigationDestination()'s destination view isn't updated when state changes

While experiments with the new NavigationStack in SwiftUI 4, I find that when state changes, the destination view returned by navigationDestination() doesn't get updated. See code below. struct ContentView: View { @State var data: [Int: String]…
rayx
  • 1,329
  • 10
  • 23
5
votes
2 answers

How to show in SwiftUI the sidebar in iPad and portrait mode

I have an master detail app in iPad, and when run the app in portrait mode the sidebar is hidden. I need to push Back button to open the sidebar. Can anyone help me to show the sidebar by default? I found an answer that suggest to use…
4
votes
1 answer

How to avoid rebuild view when tap on different button on NavigationSplitView

I have tried apple example Bringing robust navigation structure to your SwiftUI app so my code looks like this NavigationSplitView( columnVisibility: $navigationModel.columnVisibility ) { List( …
4
votes
0 answers

SwiftUI NavigationSplitView on iPad: remove accent from selected item in Sidebar

I am adopting NavigationSplitView for an app to be used on an iPad as well as on an iPhone. In my code below, I want to highlight the the selected item in the Sidebar only with the word "Selected". When running for iPad Air 5th generation, the…
HunterLion
  • 3,496
  • 1
  • 6
  • 18
4
votes
0 answers

NavigationSplitView on macOS: OutlineGroup Elements in Sidebar not selectable

I have a simple Example of NavigationSplitView with different types in the Sidebar, including an OutlineGroup. Problem: OutlineGroup's parent nodes are selectable, child nodes (leafs) are not. Nodes without children also are not selectable. Target…
ChrisR
  • 9,523
  • 1
  • 8
  • 26
3
votes
1 answer

SwiftUI 4: Is it OK to make multiple .navigationDestination() calls at different levels in view hiearchy?

I wonder if it's OK to call navigationDestination() multiple times at different levels in the view hierarchy? I googled but all the examples I found on the net called it on the top level view within NavigationStack. I tried the following code. It…
rayx
  • 1,329
  • 10
  • 23
3
votes
1 answer

SwiftUI: How to update detail column from a distant child using iOS16/iPadOS16 NavigationSplitView and NavigationLink

I'm trying to update an older app to use the new NavigationSplitView and NavigationLink, but trying to wrap my head around the proper way to do it when the sidebar has a hierarchy of child objects and I want to update the detail view from a distant…
2
votes
0 answers

NavigationSplitView resetting when app enters background

I've been trying to build an app using NavigationSplitView and SwiftUI on iOS 16. I noticed that as soon almost as the app enters the background (sometimes I have to wait a few seconds before immediately reopening the app) the contents of the…
2
votes
1 answer

New NavigationStack in SwiftUI transition, how to change from the default slide to custom or appear?

I have NavigationStack with its own navigation links, for iOS16 development. How to change the default slide transition to appear or a custom transition? Also do you apply the transition on the NavigationStack or on the NavigationLink? This is my…
2
votes
0 answers

SwiftUI NavigationSplitView column visibility on iPhone?

I'm trying to create a 3-column layout in SwiftUI. The first column is a LazyVGrid of selectable items. The selection then impacts a list of items in a content view (second column) which also isn't a SwiftUI list but a VStack + other views in a…
2
votes
1 answer

Is there any way to make NavigationSplitView's side bar with clear background?

I am trying to make side bar in NavigationSplitView with clear background for side bar, so that detail view is visible under sidebar when it is open.In UIKit it is possible to make, when iPhone in portrait mode. How can I make it in SwiftUI? In view…
2
votes
0 answers

Toolbar Menu button seems to look disabled

Overview On macOS, in a NavigationSplitView when the menu button is added to the detail view toolbar, it seems to look disabled (refer to steps to reproduce) Question: Is there a way to not look disabled (2nd time the sidebar cell is…
user1046037
  • 16,755
  • 12
  • 92
  • 138
1
2 3