/// A control for selecting from a set of values. public struct Picker: View { /// The options to be offered by the picker. private var options: [Value] /// A binding to the picker's selected option. private var value: Binding @Environment(\.self) var environment /// Creates a new picker with the given options and a binding for the /// selected value. /// /// - Parameters: /// - options: The options to be offered by the picker. /// - value: A binding to the picker's selected option. public init(of options: [Value], selection value: Binding) { self.options = options self.value = value } public var body: some View { AnyView( environment.pickerStyle.makeView( options: options, selection: value, environment: environment ) ) } }