
In this post, I’ll present a list of the principal pickers in SwiftUI:
- Default Picker
- Date Picker
- Color Picker
- Segmented Controller (yes, it’s a picker)
- Wheel
Default Picker

The code:
struct ContentView: View {
var films = ["A New Hope", "The Empire Strikes Back", "Return of the Jedi "]
@State private var selectedFilm = "The Empire Strikes Back"
var body: some View {
VStack {
Picker("Please choose a film", selection: $selectedFilm) {
ForEach(films, id: \.self) { film in
Text(film)
}
}
Text("You selected: \(selectedFilm)")
}
}
}
In this case, we show three film names, starting with the second one selected.
Date Picker
Now, we want to use a picker to select a date; in this case, we have more options:
struct ContentView: View {
@State private var date = Date()
var body: some View {
VStack {
DatePicker(…