I’m unable to use the .searchScopes modifier to add a segmented Picker to my search bar as of developer beta 6. It will not display whether I’m using a NavigationStack, NavigationSplitView, or NavigationView. Has anyone had any luck using this modifier?
This simple code will demonstrate the problem.
struct ContentView: View {
@State var searchText: String = ""
@State var searchScope: String = "Scope 1"
let data = Array(0..<20)
var body: some View {
NavigationStack {
List {
ForEach(data, id:\.self) { item in
Text("\(item)")
}
}
.searchable(text: $searchText)
.searchScopes($searchScope, scopes: {
Text("Scope 1")
Text("Scope 2")
})
}
}
}
I've submitted this as FB11298015