Embedding a NavigationStack within the detail view of a NavigationSplitView

I'm using a two column NavigationSplitView, where the view passed for the detail column is the root of a NavigationStack.

The navigation works as expected, but the navigationTitle and toolbar elements of the detail view are very slightly delayed when the view appears on iOS, such that they 'pop' in rather than smoothly animating like normal. Returning to the root of the view from views higher in this stack animates as expected.

Has anyone seen anything like this before? Thanks!

Replies

Can you share a code example that replicates the issue here? We're tracking similar bugs, but your callout of an explicit stack in the detail column is a configuration we haven't yet seen this issue with.

  • Feel free to drop a feedback here as well if possible. Thank you!

Add a Comment

Thanks for your reply - I've submitted FB12171134. Here's a minimal code example to reproduce (I appreciate the Stack here doesn't achieve anything, but the behaviour is the same):

class Row: Identifiable, Hashable {
    let id: UUID
    let title: String
    
    init(title: String) {
        self.id = UUID()
        self.title = title
    }
    
    static func == (lhs: Row, rhs: Row) -> Bool {
        return lhs.id == rhs.id
    }
    
    func hash(into hasher: inout Hasher) {
        hasher.combine(id)
    }
}

struct ContentView: View {
    let rows = [Row(title: "Row 1"), Row(title: "Row 2"), Row(title: "Row 3")]
    @State var selectedRow: Row?
    
    var body: some View {
        NavigationSplitView {
            List(selection: $selectedRow) {
                ForEach(rows) { row in
                    NavigationLink(value: row) {
                        Text(row.title)
                    }
                }
            }
            .navigationTitle("Root List")
        } detail: {
            if let selectedRow = selectedRow {
                RowView(row: selectedRow)
            }
        }
    }
}
import SwiftUI

struct RowView: View {
    let row: Row
    
    var body: some View {
        NavigationStack {
            VStack {
                Text("Detail View")
            }
            .navigationTitle(row.title)
            .toolbar {
                ToolbarItem(placement: .navigationBarTrailing) {
                    Button {
                        // Empty
                    } label: {
                        Label("Add", systemImage: "plus")
                    }
                }
            }
        }
    }
}

I am experiencing the same issue but haven't found a solution as of yet.

Is there any movement on this issue?

Dear Aaron, pls join Apple's SwiftUI team and fix it yourself, it's your best hope. Best regards, Tony

Experiencing the same on iOS 17.2 beta 3, the delay with which .toolbar appears is very noticeable

Here is an example, the toolbar items appear with delay in detail view.