I tap on picker it will open screen with list of element on that screen, can we add Search Bar?
I implemented Country Picker, in the country list I am showing country name and country code so on that list screen add Search bar find out country easily.
struct ContentView: View {
//All Country get from the plist with country Code and Coutnry Name.
let countyList = Country().getAllCountyInfo()
// Selected Country
@State private var selectedCountry = 0
var body: some View {
NavigationView {
Form {
Picker(selection: $selectedCountry, label: Text("Country")) {
ForEach(countyList) { country in
HStack{
Text(country.countryName ?? "")
Spacer()
Text(country.countryCode ?? "")
}
}
}
}
.navigationBarTitle("Select country picker")
}
}
}
by run above code it will open a country list like above screen.
on the above screen (country list).
How can I add search bar to filter country data?