Picker
A controlled SwiftUI picker with menu, segmented, radio-group, and inline styles.
#Import
Import ui from github.com/egoist/quickgui/go/ui.
import (
"github.com/egoist/quickgui/go/native"
"github.com/egoist/quickgui/go/ui"
)#Usage
func SwiftUiPickerExample() *native.Node {
value, setValue := ui.CreateSignal("list")
return ui.SwiftUI.Host(
ui.SwiftUIHostProps{MatchContents: true},
func() *native.Node {
return ui.SwiftUI.Picker(ui.SwiftUIPickerProps{
Selection: value,
Options: []ui.SwiftUIPickerOption{{Value: "list", Label: "List"}, {Value: "grid", Label: "Grid"}},
OnSelectionChange: func(next string, _ *native.Event) { setValue(next) },
})
},
)
}#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
SwiftUI.Picker
View sourceui.SwiftUI.Picker(props SwiftUIPickerProps) *native.NodeTestIDany—
Modifiersany—
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)View sourceSelectionany—
Optionsany—
Labelany—
Stylestring—
Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.
stringView source