DatePicker
A controlled native date or date-and-time picker.
#Import
Import ui from github.com/egoist/quickgui/go/ui.
import (
"github.com/egoist/quickgui/go/native"
"github.com/egoist/quickgui/go/ui"
"time"
)#Usage
func SwiftUiDatePickerExample() *native.Node {
value, setValue := ui.CreateSignal(float64(time.Now().UnixMilli()))
return ui.SwiftUI.Host(
ui.SwiftUIHostProps{MatchContents: true},
func() *native.Node {
return ui.SwiftUI.DatePicker(ui.SwiftUIDatePickerProps{
Value: value,
DisplayedComponents: "dateAndTime",
OnValueChange: func(next float64, _ *native.Event) { setValue(next) },
})
},
)
}#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
SwiftUI.DatePicker
View sourceui.SwiftUI.DatePicker(props SwiftUIDatePickerProps) *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 sourceValueany—
The current controlled value. Update application state from the change callback to accept a new value.
anyView sourceMinany—
Maxany—
Labelany—
DisplayedComponentsstring—
Stylestring—
Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.
stringView sourceOnValueChangefunc(float64, *native.Event)—
Reports an accepted value change. Use the callback payload to update controlled state.
func(float64, *native.Event)View source