If you want to have a segmented picker in your application like the one below you need to set the picker style of your Picker
view to segmented
:
struct SeasonSelectorView: View {
@State var season: Season = .summer
var body: some View {
Picker("Select the period", selection: $season) {
Text(Season.spring.rawValue).tag(Season.spring)
Text(Season.summer.rawValue).tag(Season.summer)
Text(Season.autumn.rawValue).tag(Season.autumn)
Text(Season.winter.rawValue).tag(Season.winter)
}.pickerStyle(.segmented)
}
}