Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Using .searchable inside NavigationStack inside TabView (iOS)

I noticed that when using .searchable inside a NavigationStack thats inside a TabView, the searchbar briefly overlays the content before disappearing. After that, it is hidden and appears as expected when swiping down. This only happens when the .searchable is inside the NavigationStack, there is at least one navigationTitle and the NavigationStack is inside a TabView. Tested on simulator and real device. I would appreciate any help. Thanks!

struct FirstScreen: View {
    
    var body: some View {
        TabView {
            Tab("Tab", systemImage: "heart") {
                NavigationStack {
                    NavigationLink {
                        SecondScreen()
                    } label: {
                        Text("Go to second screen")
                    }
                    .navigationTitle("First Screen")
                }
            }
        }
    }
}

struct SecondScreen: View {
    
    @State private var text: String = ""
    
    var body: some View {
        List {
            Text("Some view that extends all the way to the top")
        }
        .searchable(text: $text)
        .navigationTitle("Second Screen")
    }
}

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report, include the sample code that reproduces the issue and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

Thanks. I reported the bug.

FB17586639
Using .searchable inside NavigationStack inside TabView (iOS)
 
 
Q