PickerWithSegmentedStyleType

@MainActor
public struct PickerWithSegmentedStyleType : IntrospectableViewType

An abstract representation of the Picker type in SwiftUI, with .segmented style.

struct ContentView: View {
    @State var selection = "1"

    var body: some View {
        Picker("Pick a number", selection: $selection) {
            Text("1").tag("1")
            Text("2").tag("2")
            Text("3").tag("3")
        }
        .pickerStyle(.segmented)
        .introspect(.picker(style: .segmented), on: .iOS(.all)) {
            print(type(of: $0)) // UISegmentedControl
        }
    }
}
  • Undocumented

    See more

    Declaration

    Swift

    public enum Style