Is there a clean way to add an auxilliary view to the SwiftUI .searchable view? The best I have found is to add a VStack above the list being searched, but this makes the removal transition behave funny.
("Funny" means the search view and aux views animate away fine, but after they finish animating the List view snaps to the top of the screen, hiding the idle search field. The normal behavior leaves the idle search field showing.)
NavigationStack {
MyListView().searchable(...)
}
———
struct MyListView: View {
@Environment(\.isSearching) private var isSearching
var body: some View {
if isSearching {
VStack {...my auxilliary view...}
}
List {...}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI