Question Details

No question body available.

Tags

ios swift xcode swiftui

Answers (1)

Accepted Answer Available
Accepted Answer
June 16, 2026 Score: 2 Rep: 32,416 Quality: High Completeness: 50%

Try applying the modifier .tabViewSearchActivation(.searchTabSelection) to the TabView:

TabView {
    Tab("Home", systemImage: "house") { HomeView() }
    Tab("Ranking", systemImage: "medal") { RankingView() }
    Tab(role: .search) {
        NavigationStack {
            SearchView()
        }
    }
}
.searchable(text: $query)
.tabViewSearchActivation(.searchTabSelection) // 👈 here

When running with iOS 27.0 on the new Device Hub simulator, the morphing is not very smooth on the first attempt. But subsequent attempts are better:

Animation