Host
NSHostingView を基盤とし、QuickGUI 内に 1 つの SwiftUI コンポーネントツリーをマウントするリーフです。
#インポート
github.com/egoist/quickgui/go/ui から ui をインポートします。
import (
"github.com/egoist/quickgui/go/ui"
)#使い方
func SwiftUiHostExample() *native.Node {
return ui.SwiftUI.Host(
ui.SwiftUIHostProps{MatchContents: true},
func() *native.Node {
return ui.SwiftUI.Button(ui.SwiftUIButtonProps{Label: "Continue"})
},
)
}#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
SwiftUI.Host
ソースを見るui.SwiftUI.Host(props SwiftUIHostProps, children ...any) *native.NodeHost is a native NSHostingView laid out as one QuickGUI leaf.
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)ソースを見るStyleany—
Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.
anyソースを見るChildrenPartChildren—
Content mounted inside the component. Compound child callbacks run after the parent context exists.
PartChildrenソースを見るDisabledany—
Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.
anyソースを見るRolestring—
FocusOnPointerany—
Groupany—
AriaLabelany—
TabIndex*float64—
Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.
*float64ソースを見るOnClickfunc(*native.Event)—
Called after QuickGUI resolves an activation, including supported keyboard activation.
func(*native.Event)ソースを見る