Documentation
¶
Overview ¶
Package swiftui provides Go bindings for Apple's SwiftUI framework, enabling declarative UI construction from pure Go on macOS 26 or later.
SwiftUI is a Swift-only framework. This package includes a vendored Swift bridge (under internal/swift/) that is automatically built on first use. No external dependencies or manual setup required — just go run.
View types ¶
Three concrete view types model SwiftUI's view hierarchy:
- View is the universal opaque handle. Every constructor and universal modifier returns a View.
- ShapeView is returned by shape constructors (Circle, Rectangle, ...). It adds shape-specific modifiers such as Fill and Stroke and keeps the ShapeView type through universal modifier chains.
- TextView is returned by text constructors (Text, Label, ...). It adds text-specific modifiers such as Bold, Italic, and Font and likewise keeps the TextView type through universal modifier chains.
ShapeView and TextView embed View, so a shape or text view is usable anywhere a View is. Call AsView to drop the specialized type explicitly. The Viewable interface is satisfied by all three; functions and modifiers that take a child view accept Viewable, so any view type can be passed directly without conversion.
Function families ¶
The exported surface groups into three families:
- Building views: the View/ShapeView/TextView constructors and modifiers described above.
- Reactive state: the *State types (IntState, StringState, FloatState, BoolState, ColorState, DateState, TextSelectionState). Construct one with NewXState, bind it into a view, and call Set (or SetAnimated) to drive automatic SwiftUI updates.
- Dynamic content: helpers that rebuild views from state, such as DynamicView and ForEach-style builders, plus the callback-driven controls (Button, Stepper, ...) that invoke Go closures from SwiftUI.
Threading ¶
All View construction and modifier calls must happen on the main thread. Call runtime.LockOSThread() in init() or TestMain to pin the main goroutine. The *State Set methods (for example IntState.Set and IntState.SetAnimated) are safe to call from any goroutine — the Swift bridge dispatches the update to the MainActor automatically. To change what a running UI displays from a background goroutine, mutate the reactive state it is bound to rather than building views off the main thread.
Environment ¶
By default, the package loads the embedded bridge from a per-user cache under $HOME/Library/Caches/swiftui/bridge-cache.
To override the dylib path, set $LIBSWIFTUI_BRIDGE_PATH.
Curated media helpers include PhotosPickerLazyFileHandle for deterministic lazy file-backed assets used by sample selection state.
Curated file-picking helpers include OpenPanel for concrete NSOpenPanel-driven path selection.
Scenes ¶
Run is the single entry point for window, multi-window, menu-bar, and Settings apps: it lowers the App's Windows, MenuBar, and Settings, together with runner-owned command dispatch, into the current AppKit-owned scene runner, and OpenWindow focuses or opens a configured window by its WindowConfig.ID at runtime. Document scenes and custom command menus are runner capabilities not yet surfaced as Go API. Today that runner owns NSWindow, main-menu, NSPopover, and document-session lifecycle directly, persists per-instance window frames and visibility, supports multi-instance WindowGroup families with explicit restoration IDs and WindowInstanceCount tracking while singleton Window scenes remain explicit, exposes a concrete Settings window through the app menu, installs standard system-backed File/Edit/Window commands plus custom command menus for both windowed and menu-bar-only scene plans, presents runner-owned OpenPanel-backed document open/save panels and open/save/save-as/export/import/revert flows with dirty-close confirmation, approved close callbacks, recent-document registration, persistent recent-document restoration, last-path restoration, explicit recent-document command menus, and injects scene availability into borrowed SceneActions through the bridge callback channel.
The package also includes additive Go-native helpers such as OpenPanel, TableColumnLayoutSnapshot, PlacementHint/TaggedWithPlacement, and PhotosPickerLazyFileHandle. Those are explicit curated utilities rather than claims of one-for-one SwiftUI API parity.
This is intentionally narrower than SwiftUI's full App/Scene environment model. OpenWindowAction, app command menus, and document-session file workflows are runner-backed today, while refresh actions remain borrowed runtime capabilities rather than direct SwiftUI environment parity or a native Scene graph.
Current Parity Boundaries ¶
The current bridge is intentionally explicit about three remaining parity boundaries:
- scene/app structure: scene descriptors, multi-instance WindowGroup restoration, singleton Window scenes, WindowInstanceCount tracking, and borrowed SceneActions are supported, but the runtime is still AppKit-owned rather than a direct SwiftUI App/Scene graph
- table/outline data surfaces: the public API combines curated Go models with a native-backed additive table/outline layer, including ordered selection state, row-state summaries, and TableColumnLayoutSnapshot capture/restore, but native SwiftUI Table and OutlineGroup parity is still incomplete
- custom layout: the supported surface is the constrained Go-side layout model with PlacementHint/TaggedWithPlacement fixed-key placement metadata and placement presets rather than SwiftUI's protocol-heavy Layout and LayoutValueKey
- curated additive helpers: OpenPanel and PhotosPickerLazyFileHandle are explicit Go-native utilities rather than direct SwiftUI equivalents
Those limits are intentional source-of-truth boundaries, not accidental omissions in the generated catalog.
Example ¶
Example wires a reactive state value to a Button and a DynamicView: tapping the button mutates the state, and the DynamicView rebuilds from the new value automatically.
package main
import (
"fmt"
"github.com/tmc/swiftui"
)
func main() {
count := swiftui.NewIntState(0)
view := swiftui.VStack(
swiftui.DynamicView(count, func(n int) swiftui.View {
return swiftui.Text(fmt.Sprintf("Count: %d", n)).AsView()
}),
swiftui.Button("Increment", func() {
count.Set(count.Get() + 1)
}),
)
_ = view
}
Output:
Index ¶
- Constants
- Variables
- func Available() bool
- func Err() error
- func Main(body func())
- func MissingSymbols() []string
- func OpenWindow(id string) error
- func PlaySystemSound(name string)
- func RenderPNG(path string, root View, width, height, scale float64) error
- func Run(app App) error
- func RunMenuBar(config MenuBarConfig, content View) error
- func RunWithMenuBar(winConfig WindowConfig, content View, menuConfig MenuBarConfig, ...) error
- func UpdateMenuBarLabel(label string)
- func UpdateMenuBarLabelStyled(label string, style MenuBarLabelStyle)
- type AccessibilityTrait
- type ActivationPolicy
- type AnimationKind
- type App
- type Axis
- type BoolState
- type ButtonStyleKind
- type CanvasOps
- func (c *CanvasOps) Bytes() []byte
- func (c *CanvasOps) Clip(p *Path) *CanvasOps
- func (c *CanvasOps) Fill(p *Path, col Color) *CanvasOps
- func (c *CanvasOps) Opacity(a float64) *CanvasOps
- func (c *CanvasOps) Reset() *CanvasOps
- func (c *CanvasOps) Rotate(radians float64) *CanvasOps
- func (c *CanvasOps) Scale(sx, sy float64) *CanvasOps
- func (c *CanvasOps) Stroke(p *Path, col Color, lineWidth float64, dash []float64) *CanvasOps
- func (c *CanvasOps) Translate(dx, dy float64) *CanvasOps
- type CanvasState
- type Color
- type ColorState
- type ContentMode
- type ControlSize
- type DateState
- type Design
- type Edge
- type FloatState
- type FocusNamespace
- type Font
- type Glass
- type GlassButtonStyleKinddeprecated
- type GlassEffectTransitionKind
- type GlassShape
- type GlassStyledeprecated
- type GlassVariant
- type GridItem
- type GridItemKind
- type HorizontalAlignment
- type HoverEffectKind
- type ImageScale
- type IntState
- type LabelStyleKind
- type ListStyleKind
- type MenuBarConfig
- type MenuBarLabelStyle
- type MenuButtonStyleKind
- type MenuOrderKind
- type Namespace
- type NavigationSplitViewStyleKind
- type NavigationSplitViewVisibilityKind
- type NavigationViewStyleKind
- type OutlineNode
- type Path
- func (p *Path) Arc(cx, cy, r, startRadians, endRadians float64, clockwise bool) *Path
- func (p *Path) Bytes() []byte
- func (p *Path) Close() *Path
- func (p *Path) Cubic(c1x, c1y, c2x, c2y, x, y float64) *Path
- func (p *Path) Ellipse(x, y, w, h float64) *Path
- func (p *Path) Line(x, y float64) *Path
- func (p *Path) Move(x, y float64) *Path
- func (p *Path) Quad(cx, cy, x, y float64) *Path
- func (p *Path) Rect(x, y, w, h float64) *Path
- func (p *Path) Reset() *Path
- func (p *Path) View() View
- type PickerStyleKind
- type PointerStyleKind
- type PresentationDragIndicatorKind
- type ScrollAnchor
- type ScrollBounce
- type ScrollTargetBehaviorKind
- type SettingsConfig
- type ShapeView
- func (v ShapeView) AccessibilityHidden(hidden bool) ShapeView
- func (v ShapeView) AccessibilityHint(hint string) ShapeView
- func (v ShapeView) AccessibilityIdentifier(identifier string) ShapeView
- func (v ShapeView) AccessibilityLabel(label string) ShapeView
- func (v ShapeView) AccessibilityRotorJSON(modelJSON string) ShapeView
- func (v ShapeView) AccessibilityValue(value string) ShapeView
- func (v ShapeView) Alert(title string, message string, state *IntState) ShapeView
- func (v ShapeView) AlertPresented(title string, message string, state *BoolState) ShapeView
- func (v ShapeView) AllowsHitTesting(enabled bool) ShapeView
- func (v ShapeView) Animation(kind AnimationKind) ShapeView
- func (v ShapeView) AnimationCurve(kind AnimationKind, duration float64) ShapeView
- func (v ShapeView) AsView() View
- func (v ShapeView) AspectRatio(ratio float64, contentMode ContentMode) ShapeView
- func (v ShapeView) Background(c Color) ShapeView
- func (v ShapeView) BackgroundRoundedRect(c Color, cornerRadius float64) ShapeView
- func (v ShapeView) BackgroundStyle(name string) ShapeView
- func (v ShapeView) Blur(radius float64) ShapeView
- func (v ShapeView) Border(c Color, width float64) ShapeView
- func (v ShapeView) ButtonStyle(style ButtonStyleKind) ShapeView
- func (v ShapeView) ClipRoundedRect(cornerRadius float64) ShapeView
- func (v ShapeView) Clipped() ShapeView
- func (v ShapeView) Collapsible(collapsible bool) ShapeView
- func (v ShapeView) ConfirmationDialog(title string, state *IntState, actions Viewable) ShapeView
- func (v ShapeView) ConfirmationDialogPresented(title string, state *BoolState, actions Viewable) ShapeView
- func (v ShapeView) ContentShapeRectangle() ShapeView
- func (v ShapeView) ContextMenu(content Viewable) ShapeView
- func (v ShapeView) ControlSize(size ControlSize) ShapeView
- func (v ShapeView) CornerRadius(radius float64) ShapeView
- func (v ShapeView) DefaultScrollAnchor(anchor ScrollAnchor) ShapeView
- func (v ShapeView) Disabled(disabled bool) ShapeView
- func (v ShapeView) DraggableFileURL(path string) ShapeView
- func (v ShapeView) DraggableText(text string) ShapeView
- func (v ShapeView) DraggableURL(url string) ShapeView
- func (v ShapeView) DropDestinationFileURL(action func(string) bool) ShapeView
- func (v ShapeView) DropDestinationText(action func(string) bool) ShapeView
- func (v ShapeView) DropDestinationURL(action func(string) bool) ShapeView
- func (v ShapeView) Fill(c Color) ShapeView
- func (v ShapeView) FixedSize() ShapeView
- func (v ShapeView) FixedSizeAxis(horizontal bool, vertical bool) ShapeView
- func (v ShapeView) Focusable(focusable bool) ShapeView
- func (v ShapeView) Focused(state *BoolState) ShapeView
- func (v ShapeView) Font(f Font) ShapeView
- func (v ShapeView) FontDesign(design Design) ShapeView
- func (v ShapeView) FontWeight(weight Weight) ShapeView
- func (v ShapeView) ForegroundStyle(c Color) ShapeView
- func (v ShapeView) ForegroundStyleNamed(name string) ShapeView
- func (v ShapeView) Frame(width float64, height float64) ShapeView
- func (v ShapeView) FullScreenCover(state *IntState, content Viewable) ShapeView
- func (v ShapeView) FullScreenCoverPresented(state *BoolState, content Viewable) ShapeView
- func (v ShapeView) Help(text string) ShapeView
- func (v ShapeView) ID(id int) ShapeView
- func (v ShapeView) ImageScale(scale ImageScale) ShapeView
- func (v ShapeView) IsDetailLink(isDetailLink bool) ShapeView
- func (v ShapeView) KeyboardShortcut(key string, modifiers ShortcutModifier) ShapeView
- func (v ShapeView) LabelsHidden() ShapeView
- func (v ShapeView) LayoutPriority(priority float64) ShapeView
- func (v ShapeView) ListRowBackground(background Viewable) ShapeView
- func (v ShapeView) ListStyle(style ListStyleKind) ShapeView
- func (v ShapeView) Mask(mask Viewable) ShapeView
- func (v ShapeView) MaxFrame(maxWidth float64, maxHeight float64) ShapeView
- func (v ShapeView) MenuButtonStyle(style MenuButtonStyleKind) ShapeView
- func (v ShapeView) NavigationSplitViewStyle(style NavigationSplitViewStyleKind) ShapeView
- func (v ShapeView) NavigationTitle(title string) ShapeView
- func (v ShapeView) NavigationViewStyle(style NavigationViewStyleKind) ShapeView
- func (v ShapeView) Offset(x float64, y float64) ShapeView
- func (v ShapeView) OnAppear(action func()) ShapeView
- func (v ShapeView) OnDisappear(action func()) ShapeView
- func (v ShapeView) OnHover(action func()) ShapeView
- func (v ShapeView) OnHoverLocation(action func(bool, float64, float64)) ShapeView
- func (v ShapeView) OnHoverPhase(action func(bool)) ShapeView
- func (v ShapeView) OnTapGesture(action func()) ShapeView
- func (v ShapeView) OnTapGestureCount(count int, action func()) ShapeView
- func (v ShapeView) Opacity(opacity float64) ShapeView
- func (v ShapeView) Overlay(overlay Viewable) ShapeView
- func (v ShapeView) Padding(amount float64) ShapeView
- func (v ShapeView) PaddingEdge(edges Edge, amount float64) ShapeView
- func (v ShapeView) PointerStyle(style PointerStyleKind) ShapeView
- func (v ShapeView) Popover(state *IntState, content Viewable) ShapeView
- func (v ShapeView) PopoverPresented(state *BoolState, content Viewable) ShapeView
- func (v ShapeView) Refreshable(action func()) ShapeView
- func (v ShapeView) RotationEffect(degrees float64) ShapeView
- func (v ShapeView) SafeAreaInset(edge Edge, spacing float64, content Viewable) ShapeView
- func (v ShapeView) ScaleEffect(scale float64) ShapeView
- func (v ShapeView) ScaleEffectAt(scale float64, anchor UnitPoint) ShapeView
- func (v ShapeView) ScrollBounceBehavior(behavior ScrollBounce, axis Axis) ShapeView
- func (v ShapeView) ScrollContentBackgroundHidden() ShapeView
- func (v ShapeView) ScrollTargetBehavior(behavior ScrollTargetBehaviorKind) ShapeView
- func (v ShapeView) ScrollTargetLayout() ShapeView
- func (v ShapeView) Searchable(query *StringState, prompt string) ShapeView
- func (v ShapeView) Shadow(c Color, radius float64, x float64, y float64) ShapeView
- func (v ShapeView) Sheet(state *IntState, content Viewable) ShapeView
- func (v ShapeView) SheetPresented(state *BoolState, content Viewable) ShapeView
- func (v ShapeView) Stroke(c Color, lineWidth float64) ShapeView
- func (v ShapeView) StrokeStyle(col Color, lineWidth float64, dash []float64) ShapeView
- func (v ShapeView) SubmitLabel(label SubmitLabelKind) ShapeView
- func (v ShapeView) TabItem(label string, systemImage string) ShapeView
- func (v ShapeView) Tag(tag int32) ShapeView
- func (v ShapeView) TextFieldStyle(style TextFieldStyleKind) ShapeView
- func (v ShapeView) Tint(c Color) ShapeView
- func (v ShapeView) ToggleStyle(style ToggleStyleKind) ShapeView
- func (v ShapeView) ToolbarItem(placement ToolbarItemPlacement, content Viewable) ShapeView
- func (v ShapeView) ToolbarRole(role ToolbarRole) ShapeView
- func (v ShapeView) WebViewBackForwardNavigationGestures(behavior WebViewBehavior) ShapeView
- func (v ShapeView) WebViewContentBackground(visibility WebViewContentBackgroundVisibility) ShapeView
- func (v ShapeView) WebViewElementFullscreenBehavior(behavior WebViewBehavior) ShapeView
- func (v ShapeView) WebViewLinkPreviews(behavior WebViewBehavior) ShapeView
- func (v ShapeView) WebViewMagnificationGestures(behavior WebViewBehavior) ShapeView
- func (v ShapeView) WebViewTextSelection(enabled bool) ShapeView
- func (v ShapeView) ZIndex(index float64) ShapeView
- type ShortcutModifier
- type StringState
- type SubmitLabelKind
- type SymbolRenderingMode
- type TableColumnSpec
- type TextAlignment
- type TextFieldStyleKind
- type TextSelectionState
- type TextView
- func (v TextView) AccessibilityHidden(hidden bool) TextView
- func (v TextView) AccessibilityHint(hint string) TextView
- func (v TextView) AccessibilityIdentifier(identifier string) TextView
- func (v TextView) AccessibilityLabel(label string) TextView
- func (v TextView) AccessibilityRotorJSON(modelJSON string) TextView
- func (v TextView) AccessibilityValue(value string) TextView
- func (v TextView) Alert(title string, message string, state *IntState) TextView
- func (v TextView) AlertPresented(title string, message string, state *BoolState) TextView
- func (v TextView) AllowsHitTesting(enabled bool) TextView
- func (v TextView) Animation(kind AnimationKind) TextView
- func (v TextView) AnimationCurve(kind AnimationKind, duration float64) TextView
- func (v TextView) AsView() View
- func (v TextView) AspectRatio(ratio float64, contentMode ContentMode) TextView
- func (v TextView) Background(c Color) TextView
- func (v TextView) BackgroundRoundedRect(c Color, cornerRadius float64) TextView
- func (v TextView) BackgroundStyle(name string) TextView
- func (v TextView) Blur(radius float64) TextView
- func (v TextView) Bold() TextView
- func (v TextView) Border(c Color, width float64) TextView
- func (v TextView) ButtonStyle(style ButtonStyleKind) TextView
- func (v TextView) ClipRoundedRect(cornerRadius float64) TextView
- func (v TextView) Clipped() TextView
- func (v TextView) Collapsible(collapsible bool) TextView
- func (v TextView) ConfirmationDialog(title string, state *IntState, actions Viewable) TextView
- func (v TextView) ConfirmationDialogPresented(title string, state *BoolState, actions Viewable) TextView
- func (v TextView) ContentShapeRectangle() TextView
- func (v TextView) ContextMenu(content Viewable) TextView
- func (v TextView) ControlSize(size ControlSize) TextView
- func (v TextView) CornerRadius(radius float64) TextView
- func (v TextView) DefaultScrollAnchor(anchor ScrollAnchor) TextView
- func (v TextView) Disabled(disabled bool) TextView
- func (v TextView) DraggableFileURL(path string) TextView
- func (v TextView) DraggableText(text string) TextView
- func (v TextView) DraggableURL(url string) TextView
- func (v TextView) DropDestinationFileURL(action func(string) bool) TextView
- func (v TextView) DropDestinationText(action func(string) bool) TextView
- func (v TextView) DropDestinationURL(action func(string) bool) TextView
- func (v TextView) FixedSize() TextView
- func (v TextView) FixedSizeAxis(horizontal bool, vertical bool) TextView
- func (v TextView) Focusable(focusable bool) TextView
- func (v TextView) Focused(state *BoolState) TextView
- func (v TextView) Font(f Font) TextView
- func (v TextView) FontDesign(design Design) TextView
- func (v TextView) FontWeight(weight Weight) TextView
- func (v TextView) ForegroundStyle(c Color) TextView
- func (v TextView) ForegroundStyleNamed(name string) TextView
- func (v TextView) Frame(width float64, height float64) TextView
- func (v TextView) FullScreenCover(state *IntState, content Viewable) TextView
- func (v TextView) FullScreenCoverPresented(state *BoolState, content Viewable) TextView
- func (v TextView) Help(text string) TextView
- func (v TextView) ID(id int) TextView
- func (v TextView) ImageScale(scale ImageScale) TextView
- func (v TextView) IsDetailLink(isDetailLink bool) TextView
- func (v TextView) Italic() TextView
- func (v TextView) KeyboardShortcut(key string, modifiers ShortcutModifier) TextView
- func (v TextView) LabelsHidden() TextView
- func (v TextView) LayoutPriority(priority float64) TextView
- func (v TextView) LineLimit(n int) TextView
- func (v TextView) ListRowBackground(background Viewable) TextView
- func (v TextView) ListStyle(style ListStyleKind) TextView
- func (v TextView) Mask(mask Viewable) TextView
- func (v TextView) MaxFrame(maxWidth float64, maxHeight float64) TextView
- func (v TextView) MenuButtonStyle(style MenuButtonStyleKind) TextView
- func (v TextView) MonospacedDigit() TextView
- func (v TextView) MultilineTextAlignment(alignment TextAlignment) TextView
- func (v TextView) NavigationSplitViewStyle(style NavigationSplitViewStyleKind) TextView
- func (v TextView) NavigationTitle(title string) TextView
- func (v TextView) NavigationViewStyle(style NavigationViewStyleKind) TextView
- func (v TextView) Offset(x float64, y float64) TextView
- func (v TextView) OnAppear(action func()) TextView
- func (v TextView) OnDisappear(action func()) TextView
- func (v TextView) OnHover(action func()) TextView
- func (v TextView) OnHoverLocation(action func(bool, float64, float64)) TextView
- func (v TextView) OnHoverPhase(action func(bool)) TextView
- func (v TextView) OnTapGesture(action func()) TextView
- func (v TextView) OnTapGestureCount(count int, action func()) TextView
- func (v TextView) Opacity(opacity float64) TextView
- func (v TextView) Overlay(overlay Viewable) TextView
- func (v TextView) Padding(amount float64) TextView
- func (v TextView) PaddingEdge(edges Edge, amount float64) TextView
- func (v TextView) PointerStyle(style PointerStyleKind) TextView
- func (v TextView) Popover(state *IntState, content Viewable) TextView
- func (v TextView) PopoverPresented(state *BoolState, content Viewable) TextView
- func (v TextView) Refreshable(action func()) TextView
- func (v TextView) RotationEffect(degrees float64) TextView
- func (v TextView) SafeAreaInset(edge Edge, spacing float64, content Viewable) TextView
- func (v TextView) ScaleEffect(scale float64) TextView
- func (v TextView) ScaleEffectAt(scale float64, anchor UnitPoint) TextView
- func (v TextView) ScrollBounceBehavior(behavior ScrollBounce, axis Axis) TextView
- func (v TextView) ScrollContentBackgroundHidden() TextView
- func (v TextView) ScrollTargetBehavior(behavior ScrollTargetBehaviorKind) TextView
- func (v TextView) ScrollTargetLayout() TextView
- func (v TextView) Searchable(query *StringState, prompt string) TextView
- func (v TextView) Shadow(c Color, radius float64, x float64, y float64) TextView
- func (v TextView) Sheet(state *IntState, content Viewable) TextView
- func (v TextView) SheetPresented(state *BoolState, content Viewable) TextView
- func (v TextView) Strikethrough() TextView
- func (v TextView) SubmitLabel(label SubmitLabelKind) TextView
- func (v TextView) SymbolRenderingMode(mode SymbolRenderingMode) TextView
- func (v TextView) TabItem(label string, systemImage string) TextView
- func (v TextView) Tag(tag int32) TextView
- func (v TextView) TextFieldStyle(style TextFieldStyleKind) TextView
- func (v TextView) Tint(c Color) TextView
- func (v TextView) ToggleStyle(style ToggleStyleKind) TextView
- func (v TextView) ToolbarItem(placement ToolbarItemPlacement, content Viewable) TextView
- func (v TextView) ToolbarRole(role ToolbarRole) TextView
- func (v TextView) TruncationMode(mode TruncationMode) TextView
- func (v TextView) Underline() TextView
- func (v TextView) WebViewBackForwardNavigationGestures(behavior WebViewBehavior) TextView
- func (v TextView) WebViewContentBackground(visibility WebViewContentBackgroundVisibility) TextView
- func (v TextView) WebViewElementFullscreenBehavior(behavior WebViewBehavior) TextView
- func (v TextView) WebViewLinkPreviews(behavior WebViewBehavior) TextView
- func (v TextView) WebViewMagnificationGestures(behavior WebViewBehavior) TextView
- func (v TextView) WebViewTextSelection(enabled bool) TextView
- func (v TextView) ZIndex(index float64) TextView
- type ToggleStyleKind
- type ToolbarItemPlacement
- type ToolbarRole
- type Transition
- type TruncationMode
- type UnitPoint
- type VerticalAlignment
- type View
- func AnimatedDynamicBoolView(state *BoolState, transition Transition, builder func(value bool) View) View
- func AnimatedDynamicFloatView(state *FloatState, transition Transition, builder func(value float64) View) View
- func AnimatedDynamicView(state *IntState, transition Transition, builder func(value int) View) View
- func AsyncImage(url string) View
- func Button(label string, action func()) View
- func ButtonView(label Viewable, action func()) View
- func ButtonWithImage(systemName string, action func()) View
- func ButtonWithLabel(text string, systemImage string, action func()) View
- func Canvas(state *CanvasState, width, height float64) View
- func ColorPicker(label string, state *ColorState, onChange func()) View
- func ColorView(c Color) View
- func DatePicker(label string, state *DateState, onChange func()) View
- func DisclosureGroupView(label Viewable, expanded *BoolState, content Viewable) View
- func Divider() View
- func DynamicBoolView(state *BoolState, builder func(value bool) View) View
- func DynamicFloatView(state *FloatState, builder func(value float64) View) View
- func DynamicView(state *IntState, builder func(value int) View) View
- func EmptyView() View
- func FloatGauge(label string, state *FloatState, min float64, max float64) View
- func FloatProgressView(state *FloatState, total float64) View
- func FloatSlider(label string, state *FloatState, min float64, max float64, onChange func()) View
- func Form(children ...Viewable) View
- func Gauge(value float64, label string) View
- func GeometryReader(builder func(width, height float64) View) View
- func GlassEffectContainer(content View) View
- func GlassEffectContainerSpaced(spacing float64, content View) View
- func GroupBox(label string, content Viewable) View
- func HStack(children ...Viewable) View
- func HStackAligned(alignment VerticalAlignment, children ...Viewable) View
- func HStackAlignedSpaced(alignment VerticalAlignment, spacing float64, children ...Viewable) View
- func HStackSpaced(spacing float64, children ...Viewable) View
- func Image(systemName string) View
- func ImageFromFile(path string) View
- func ImageNamed(name string) View
- func LazyHGrid(rows []GridItem, spacing float64, children ...Viewable) View
- func LazyHStack(children ...Viewable) View
- func LazyVGrid(columns []GridItem, spacing float64, children ...Viewable) View
- func LazyVStack(children ...Viewable) View
- func LinearGradient(start, end Color, startPoint, endPoint UnitPoint) View
- func LinearGradientHorizontal(leading, trailing Color) View
- func LinearGradientVertical(top, bottom Color) View
- func Link(title string, url string) View
- func List(children ...Viewable) View
- func Menu(label string, content Viewable) View
- func MenuView(label Viewable, content Viewable) View
- func MeshGradient4(topLeading, topTrailing, bottomLeading, bottomTrailing Color) View
- func NavigationLink(label string, destination Viewable) View
- func NavigationSplitView(sidebar Viewable, detail Viewable) View
- func NavigationSplitViewTriple(sidebar Viewable, content Viewable, detail Viewable) View
- func NavigationSplitViewTripleVisibility(visibility *IntState, sidebar Viewable, content Viewable, detail Viewable) View
- func NavigationSplitViewVisibility(visibility *IntState, sidebar Viewable, detail Viewable) View
- func NavigationStack(content Viewable) View
- func OutlineGroup(nodes ...OutlineNode) View
- func PasteButton(label string, state *StringState) View
- func PhaseAnimator(phases []int32, content func(value int) View, animation AnimationKind) View
- func PhaseAnimatorTrigger(phases []int32, trigger int32, content func(value int) View, ...) View
- func PickerMenu(label string, state *IntState, options Viewable, onChange func()) View
- func PickerSegmented(label string, state *IntState, options Viewable, onChange func()) View
- func ProgressLinear(value float64, total float64) View
- func ProgressSpinning() View
- func RadialGradient(inner, outer Color, center UnitPoint, startRadius, endRadius float64) View
- func ScrollView(content Viewable) View
- func ScrollViewReader(position *IntState, anchor ScrollAnchor, content Viewable) View
- func Section(header string, content Viewable) View
- func SectionExpanded(header string, expanded *BoolState, content Viewable) View
- func SectionExpandedView(header Viewable, expanded *BoolState, content Viewable) View
- func SecureField(placeholder string, state *StringState, onSubmit func()) View
- func SecureFieldCallbacks(placeholder string, state *StringState, onChange func(), onSubmit func()) View
- func SecureFieldCallbacksSelection(placeholder string, state *StringState, selection *TextSelectionState, ...) View
- func SecureFieldSelection(placeholder string, state *StringState, selection *TextSelectionState, ...) View
- func SelectableList(selection *IntState, children ...Viewable) View
- func ShareLink(title string, url string) View
- func ShareLinkItemRaw(title string, kind string, value string, filePath string) View
- func Slider(label string, state *IntState, min float64, max float64, onChange func()) View
- func SliderTickContentForEach(values []int32, id int32, content func(value int) View) View
- func Spacer() View
- func Stepper(label string, state *IntState, min int, max int, onChange func()) View
- func TabView(children ...Viewable) View
- func Table(rows int, columns ...TableColumnSpec) View
- func TextEditor(state *StringState) View
- func TextEditorOnChange(state *StringState, onChange func()) View
- func TextEditorOnChangeSelection(state *StringState, selection *TextSelectionState, onChange func()) View
- func TextEditorSelection(state *StringState, selection *TextSelectionState) View
- func TextField(placeholder string, state *StringState, onSubmit func()) View
- func TextFieldCallbacks(placeholder string, state *StringState, onChange func(), onSubmit func()) View
- func TextFieldCallbacksSelection(placeholder string, state *StringState, selection *TextSelectionState, ...) View
- func TextFieldSelection(placeholder string, state *StringState, selection *TextSelectionState, ...) View
- func Toggle(label string, state *IntState, onChange func()) View
- func VStack(children ...Viewable) View
- func VStackAligned(alignment HorizontalAlignment, children ...Viewable) View
- func VStackAlignedSpaced(alignment HorizontalAlignment, spacing float64, children ...Viewable) View
- func VStackSpaced(spacing float64, children ...Viewable) View
- func ViewFromPointer(ptr uintptr) View
- func ZStack(children ...Viewable) View
- func (v View) AccessibilityHidden(hidden bool) View
- func (v View) AccessibilityHint(hint string) View
- func (v View) AccessibilityIdentifier(identifier string) View
- func (v View) AccessibilityLabel(label string) View
- func (v View) AccessibilityRotorJSON(modelJSON string) View
- func (v View) AccessibilityValue(value string) View
- func (v View) Alert(title string, message string, state *IntState) View
- func (v View) AlertPresented(title string, message string, state *BoolState) View
- func (v View) AllowsHitTesting(enabled bool) View
- func (v View) Animation(kind AnimationKind) View
- func (v View) AnimationCurve(kind AnimationKind, duration float64) View
- func (v View) AspectRatio(ratio float64, contentMode ContentMode) View
- func (v View) Background(c Color) View
- func (v View) BackgroundRoundedRect(c Color, cornerRadius float64) View
- func (v View) BackgroundStyle(name string) View
- func (v View) Blur(radius float64) View
- func (v View) Border(c Color, width float64) View
- func (v View) ButtonStyle(style ButtonStyleKind) View
- func (v View) ClipRoundedRect(cornerRadius float64) View
- func (v View) Clipped() View
- func (v View) Collapsible(collapsible bool) View
- func (v View) ConfirmationDialog(title string, state *IntState, actions Viewable) View
- func (v View) ConfirmationDialogPresented(title string, state *BoolState, actions Viewable) View
- func (v View) ContentShapeRectangle() View
- func (v View) ContextMenu(content Viewable) View
- func (v View) ControlSize(size ControlSize) View
- func (v View) CornerRadius(radius float64) View
- func (v View) DefaultScrollAnchor(anchor ScrollAnchor) View
- func (v View) Disabled(disabled bool) View
- func (v View) DraggableFileURL(path string) View
- func (v View) DraggableText(text string) View
- func (v View) DraggableURL(url string) View
- func (v View) DropDestinationFileURL(action func(string) bool) View
- func (v View) DropDestinationText(action func(string) bool) View
- func (v View) DropDestinationURL(action func(string) bool) View
- func (v View) FixedSize() View
- func (v View) FixedSizeAxis(horizontal bool, vertical bool) View
- func (v View) FocusScopeID(namespace *FocusNamespace) View
- func (v View) FocusSection() View
- func (v View) Focusable(focusable bool) View
- func (v View) Focused(state *BoolState) View
- func (v View) Font(f Font) View
- func (v View) FontDesign(design Design) View
- func (v View) FontWeight(weight Weight) View
- func (v View) ForegroundStyle(c Color) View
- func (v View) ForegroundStyleNamed(name string) View
- func (v View) Frame(width float64, height float64) View
- func (v View) FullScreenCover(state *IntState, content Viewable) View
- func (v View) FullScreenCoverPresented(state *BoolState, content Viewable) View
- func (v View) GlassButtonStyle(glass Glass) View
- func (v View) GlassEffect() View
- func (v View) GlassEffectID(id string, namespace *Namespace) View
- func (v View) GlassEffectIn(glass Glass, shape GlassShape, cornerRadius float64) View
- func (v View) GlassEffectShape(shape GlassShape, cornerRadius float64) View
- func (v View) GlassEffectTransition(transition GlassEffectTransitionKind) View
- func (v View) GlassEffectUnion(id string, namespace *Namespace) View
- func (v View) GlassEffectWith(glass Glass) View
- func (v View) GlassProminentButtonStyle() View
- func (v View) Help(text string) View
- func (v View) ID(id int) View
- func (v View) ImageScale(scale ImageScale) View
- func (v View) IsDetailLink(isDetailLink bool) View
- func (v View) KeyboardShortcut(key string, modifiers ShortcutModifier) View
- func (v View) LabelsHidden() View
- func (v View) LayoutPriority(priority float64) View
- func (v View) ListRowBackground(background Viewable) View
- func (v View) ListStyle(style ListStyleKind) View
- func (v View) Mask(mask Viewable) View
- func (v View) MaxFrame(maxWidth float64, maxHeight float64) View
- func (v View) MenuButtonStyle(style MenuButtonStyleKind) View
- func (v View) NavigationSplitViewStyle(style NavigationSplitViewStyleKind) View
- func (v View) NavigationTitle(title string) View
- func (v View) NavigationViewStyle(style NavigationViewStyleKind) View
- func (v View) Offset(x float64, y float64) View
- func (v View) OnAppear(action func()) View
- func (v View) OnDisappear(action func()) View
- func (v View) OnHover(action func()) View
- func (v View) OnHoverLocation(action func(bool, float64, float64)) View
- func (v View) OnHoverPhase(action func(bool)) View
- func (v View) OnTapGesture(action func()) View
- func (v View) OnTapGestureCount(count int, action func()) View
- func (v View) Opacity(opacity float64) View
- func (v View) Overlay(overlay Viewable) View
- func (v View) Padding(amount float64) View
- func (v View) PaddingEdge(edges Edge, amount float64) View
- func (v View) Pointer() uintptr
- func (v View) PointerStyle(style PointerStyleKind) View
- func (v View) Popover(state *IntState, content Viewable) View
- func (v View) PopoverPresented(state *BoolState, content Viewable) View
- func (v View) PrefersDefaultFocus(preferred bool, namespace *FocusNamespace) View
- func (v View) Refreshable(action func()) View
- func (v *View) Release()
- func (v View) RotationEffect(degrees float64) View
- func (v View) SafeAreaInset(edge Edge, spacing float64, content Viewable) View
- func (v View) ScaleEffect(scale float64) View
- func (v View) ScaleEffectAt(scale float64, anchor UnitPoint) View
- func (v View) ScrollBounceBehavior(behavior ScrollBounce, axis Axis) View
- func (v View) ScrollContentBackgroundHidden() View
- func (v View) ScrollTargetBehavior(behavior ScrollTargetBehaviorKind) View
- func (v View) ScrollTargetLayout() View
- func (v View) Searchable(query *StringState, prompt string) View
- func (v View) Shadow(c Color, radius float64, x float64, y float64) View
- func (v View) Sheet(state *IntState, content Viewable) View
- func (v View) SheetPresented(state *BoolState, content Viewable) View
- func (v View) SubmitLabel(label SubmitLabelKind) View
- func (v View) TabItem(label string, systemImage string) View
- func (v View) Tag(tag int32) View
- func (v View) TextFieldStyle(style TextFieldStyleKind) View
- func (v View) Tint(c Color) View
- func (v View) ToggleStyle(style ToggleStyleKind) View
- func (v View) ToolbarItem(placement ToolbarItemPlacement, content Viewable) View
- func (v View) ToolbarRole(role ToolbarRole) View
- func (v View) WebViewBackForwardNavigationGestures(behavior WebViewBehavior) View
- func (v View) WebViewContentBackground(visibility WebViewContentBackgroundVisibility) View
- func (v View) WebViewElementFullscreenBehavior(behavior WebViewBehavior) View
- func (v View) WebViewLinkPreviews(behavior WebViewBehavior) View
- func (v View) WebViewMagnificationGestures(behavior WebViewBehavior) View
- func (v View) WebViewTextSelection(enabled bool) View
- func (v View) ZIndex(index float64) View
- type Viewable
- type WebPagedeprecated
- func NewWebPage() *WebPagedeprecated
- func NewWebPageURL(url string) *WebPagedeprecated
- type WebViewBehavior
- type WebViewContentBackgroundVisibility
- type Weight
- type WindowConfig
Examples ¶
Constants ¶
const ( FrameInfinity = -1.0 FrameUnset = 0.0 )
Frame sizing sentinels for MaxFrame's maxWidth/maxHeight arguments.
FrameInfinity maps to SwiftUI's .infinity (expand to fill the available space along that axis); FrameUnset maps to nil (no maximum constraint). They are untyped float constants so they can be passed directly to MaxFrame.
Variables ¶
var ( // ErrNoSurface is returned by Run when an App configures neither a window // nor a menu bar item; such an app would launch with nothing to show and no // way to quit. A Settings scene alone does not satisfy this requirement. ErrNoSurface = errors.New("swiftui: App configures no surface (set Windows or MenuBar)") // ErrWindowID is returned by Run when a multi-window App (or an App with a // Settings scene alongside multiple windows) has a window with an empty or // duplicate ID. Window identity is required so OpenWindow can address each // window, and must not be derived from the mutable Title. ErrWindowID = errors.New("swiftui: multi-window App requires a unique non-empty WindowConfig.ID") // ErrNoWindow is returned by OpenWindow when no window configured in the // running App has the given id. ErrNoWindow = errors.New("swiftui: no window with that id") // ErrAppNotRunning is returned by OpenWindow when it is called before Run // has started the application event loop. ErrAppNotRunning = errors.New("swiftui: OpenWindow called before Run") )
var ( // UnitPointTopLeading is the upper leading corner. UnitPointTopLeading = UnitPoint{X: 0, Y: 0} // UnitPointTop is the upper edge midpoint. UnitPointTop = UnitPoint{X: 0.5, Y: 0} // UnitPointTopTrailing is the upper trailing corner. UnitPointTopTrailing = UnitPoint{X: 1, Y: 0} // UnitPointLeading is the leading edge midpoint. UnitPointLeading = UnitPoint{X: 0, Y: 0.5} // UnitPointCenter is the rectangle center. UnitPointCenter = UnitPoint{X: 0.5, Y: 0.5} // UnitPointTrailing is the trailing edge midpoint. UnitPointTrailing = UnitPoint{X: 1, Y: 0.5} // UnitPointBottomLeading is the lower leading corner. UnitPointBottomLeading = UnitPoint{X: 0, Y: 1} // UnitPointBottom is the lower edge midpoint. UnitPointBottom = UnitPoint{X: 0.5, Y: 1} // UnitPointBottomTrailing is the lower trailing corner. UnitPointBottomTrailing = UnitPoint{X: 1, Y: 1} )
Functions ¶
func Available ¶
func Available() bool
Available reports whether the SwiftUI bridge dylib loaded successfully.
Available may be true even when MissingSymbols is non-empty: the dylib loaded, but some entry points this build expects are absent.
func Err ¶
func Err() error
Err reports the error encountered while loading the SwiftUI bridge, or nil if the bridge loaded successfully.
A nil Err with a non-empty MissingSymbols means the dylib loaded but is missing some expected entry points; calls into those entry points panic.
func Main ¶
func Main(body func())
Main locks the calling goroutine to its OS thread and runs body. The AppKit run loop must own the main OS thread, so any goroutine that calls Run must be pinned to a single thread for the lifetime of the process. Calling Main from main (or from a goroutine started with an explicit runtime.LockOSThread) satisfies that requirement:
func main() {
swiftui.Main(func() {
win := swiftui.WindowConfig{Title: "Hi", Root: root}
swiftui.Run(swiftui.App{Windows: []swiftui.WindowConfig{win}})
})
}
Run locks the thread itself, so Main is a convenience for programs that perform setup before the run loop starts.
func MissingSymbols ¶
func MissingSymbols() []string
MissingSymbols returns the names of bridge symbols this build expected but did not find in the loaded dylib. The result is empty when the dylib is fully compatible (or when the dylib did not load at all, in which case use Err).
func OpenWindow ¶
OpenWindow focuses the window whose WindowConfig.ID equals id, opening it if it is not currently on screen. It addresses only windows configured in the App passed to Run; it does not create new windows.
OpenWindow must be called on the AppKit main thread after Run has started the event loop, typically from a view callback. It returns the bridge load error if the dylib failed to load (the same non-nil error Run would return), ErrAppNotRunning before Run, ErrNoWindow when no configured window has the given id, or nil once the window is opened or focused. The runner is AppKit-backed today rather than direct SwiftUI OpenWindowAction parity.
func PlaySystemSound ¶
func PlaySystemSound(name string)
PlaySystemSound plays a macOS system sound by name. Common names: "Basso", "Blow", "Bottle", "Frog", "Funk", "Glass", "Hero", "Morse", "Ping", "Pop", "Purr", "Sosumi", "Submarine", "Tink".
func Run ¶
Run starts the application event loop for app, presenting every window in app.Windows together with any MenuBar and Settings scene, and blocks until the application exits. Single-window and multi-window apps go through this same call.
Run returns ErrNoSurface if the App configures no window and no menu bar item, ErrWindowID if a multi-window App has a window with an empty or duplicate ID, or a non-nil error if the bridge dylib failed to load.
// A window:
win := swiftui.WindowConfig{Title: "Hi", Width: 400, Height: 300, Root: root}
swiftui.Run(swiftui.App{Windows: []swiftui.WindowConfig{win}})
// A menu-bar-only app (no Dock icon):
swiftui.Run(swiftui.App{MenuBar: &swiftui.MenuBarConfig{Label: "Hi", Content: panel}})
// Multiple windows, addressable at runtime by OpenWindow:
main := swiftui.WindowConfig{ID: "main", Title: "Main", Root: mainView}
insp := swiftui.WindowConfig{ID: "inspector", Title: "Inspector", Root: inspView}
swiftui.Run(swiftui.App{Windows: []swiftui.WindowConfig{main, insp}})
func RunMenuBar ¶
func RunMenuBar(config MenuBarConfig, content View) error
RunMenuBar is a convenience for a menu-bar-only app: Run(App{MenuBar: &config}). The content View is shown in a popover when the status item is clicked.
func RunWithMenuBar ¶
func RunWithMenuBar(winConfig WindowConfig, content View, menuConfig MenuBarConfig, menuContent View) error
RunWithMenuBar is a convenience for a windowed app that also installs a menu bar item: Run(App{Windows: []WindowConfig{winConfig}, MenuBar: &menuConfig}).
func UpdateMenuBarLabel ¶
func UpdateMenuBarLabel(label string)
UpdateMenuBarLabel changes the status item text at runtime.
func UpdateMenuBarLabelStyled ¶
func UpdateMenuBarLabelStyled(label string, style MenuBarLabelStyle)
UpdateMenuBarLabelStyled updates the status item text with optional styling. If the styled bridge symbol is unavailable, this falls back to UpdateMenuBarLabel.
Types ¶
type AccessibilityTrait ¶
type AccessibilityTrait int32
AccessibilityTrait identifies accessibility trait flags.
const ( AccessibilityTraitNone AccessibilityTrait = 0 AccessibilityTraitHeader AccessibilityTrait = 2 AccessibilityTraitButton AccessibilityTrait = 4 AccessibilityTraitSearchField AccessibilityTrait = 8 AccessibilityTraitStaticText AccessibilityTrait = 16 )
type ActivationPolicy ¶
type ActivationPolicy int32
ActivationPolicy controls whether the app shows a Dock icon and main menu. The zero value, PolicyDefault, is auto: an app with a window is Regular and a menu-bar-only app is Accessory.
const ( // PolicyDefault derives the policy from the surfaces present: Regular when a // window is configured, Accessory when only a menu bar item is. PolicyDefault ActivationPolicy = 0 // PolicyRegular shows a Dock icon and the application main menu. PolicyRegular ActivationPolicy = 1 // PolicyAccessory hides the Dock icon and main menu (typical for menu-bar // apps that live only in the status bar). PolicyAccessory ActivationPolicy = 2 // PolicyProhibited hides the Dock icon, main menu, and any windows from the // switcher (background agents). PolicyProhibited ActivationPolicy = 3 )
type AnimationKind ¶
type AnimationKind int32
AnimationKind identifies animation curve presets.
const ( AnimationEaseInOut AnimationKind = 0 AnimationEaseIn AnimationKind = 1 AnimationEaseOut AnimationKind = 2 AnimationSpring AnimationKind = 3 AnimationBouncy AnimationKind = 4 )
type App ¶
type App struct {
// Windows are the application's windows. Run presents all of them; the
// first window is the initial key window.
Windows []WindowConfig
// MenuBar, when non-nil, installs a menu bar (status bar) item.
MenuBar *MenuBarConfig
// Settings, when non-nil, installs a Settings scene reachable from the
// app menu (Cmd-,). A Settings scene is an adornment on a windowed or
// menu-bar app, not a surface of its own.
Settings *SettingsConfig
// Policy overrides the Dock-icon and main-menu behavior. The zero value
// derives it from the configured surfaces; see ActivationPolicy.
Policy ActivationPolicy
}
App describes the surfaces an application presents. An empty Windows slice or a nil MenuBar means that surface is absent, so the same App type expresses single-window, multi-window, menu-bar-only, and window-plus-menu-bar apps. At least one window or a menu bar item must be configured; a Settings scene alone is not a surface (see ErrNoSurface).
Run presents every window in Windows. When more than one window is configured (or a Settings scene is present), each WindowConfig.ID must be non-empty and unique so OpenWindow can address it; Run reports ErrWindowID otherwise.
type BoolState ¶
type BoolState struct {
// contains filtered or unexported fields
}
BoolState is an observable boolean state value.
func NewBoolState ¶
NewBoolState creates a new observable boolean state.
func (*BoolState) Release ¶
func (s *BoolState) Release()
Release decrements the underlying Swift retain count.
After Release the state must not be used or passed to a view again, and a state that is currently bound into a live view must not be released; doing either leaves the view referencing a freed handle.
func (*BoolState) SetAnimated ¶
SetAnimated updates the boolean value with the default ease-in-out animation.
func (*BoolState) SetAnimatedWith ¶
func (s *BoolState) SetAnimatedWith(v bool, kind AnimationKind)
SetAnimatedWith updates the boolean value using the provided animation curve.
type ButtonStyleKind ¶
type ButtonStyleKind int32
ButtonStyleKind identifies button display styles.
const ( ButtonStyleAutomatic ButtonStyleKind = 0 ButtonStyleBordered ButtonStyleKind = 1 ButtonStyleBorderedProminent ButtonStyleKind = 2 ButtonStyleBorderless ButtonStyleKind = 3 ButtonStylePlain ButtonStyleKind = 4 )
type CanvasOps ¶
type CanvasOps struct {
// contains filtered or unexported fields
}
CanvasOps is a mutable opcode buffer for a Canvas render pass. Build one by calling NewCanvasOps and appending stroke/fill/transform/opacity opcodes; the whole buffer is submitted to Swift as a single blob via CanvasState.Set.
CanvasOps does not validate that Paths referenced by Stroke/Fill/Clip outlive the render pass — the opcode stream copies path bytes inline, so the caller's Path can be reused or discarded after the Stroke/Fill/Clip call returns.
func (*CanvasOps) Bytes ¶
Bytes returns a reference to the opcode buffer. The slice is valid until the next mutation on c.
func (*CanvasOps) Reset ¶
Reset clears the opcode buffer without releasing backing storage. Useful for per-frame rebuilds.
type CanvasState ¶
type CanvasState struct {
// contains filtered or unexported fields
}
CanvasState holds an opcode blob on the Swift side; the Canvas view observes it and re-renders whenever Set publishes a new blob. The lifecycle mirrors NumberState / FloatState.
func NewCanvasState ¶
func NewCanvasState(initial *CanvasOps) *CanvasState
NewCanvasState creates a new CanvasState initialized to the given opcode blob. Pass nil for an empty Canvas.
func (*CanvasState) Set ¶
func (s *CanvasState) Set(ops *CanvasOps)
Set publishes a new opcode blob, triggering Canvas re-render.
type Color ¶
type Color struct {
R, G, B, A float64
}
Color represents an RGBA color value.
type ColorState ¶
type ColorState struct {
// contains filtered or unexported fields
}
ColorState is a reactive RGBA color state that bridges Go and SwiftUI.
func NewColorState ¶
func NewColorState(r, g, b, a float64) *ColorState
NewColorState creates a new reactive color state from RGBA values (0.0-1.0).
func (*ColorState) Release ¶
func (s *ColorState) Release()
Release decrements the underlying Swift retain count.
After Release the state must not be used or passed to a view again, and a state that is currently bound into a live view must not be released; doing either leaves the view referencing a freed handle.
func (*ColorState) Set ¶
func (s *ColorState) Set(r, g, b, a float64)
Set updates the RGBA color values.
type ContentMode ¶
type ContentMode int32
ContentMode identifies aspect ratio content modes.
const ( ContentModeFit ContentMode = 0 ContentModeFill ContentMode = 1 )
type ControlSize ¶
type ControlSize int32
ControlSize identifies control sizing presets.
const ( ControlSizeMini ControlSize = 0 ControlSizeSmall ControlSize = 1 ControlSizeRegular ControlSize = 2 ControlSizeLarge ControlSize = 3 ControlSizeExtraLarge ControlSize = 4 )
type DateState ¶
type DateState struct {
// contains filtered or unexported fields
}
DateState is a reactive date state that bridges Go and SwiftUI. Dates are represented as Unix epoch seconds (float64).
func NewDateState ¶
NewDateState creates a new reactive date state from Unix epoch seconds.
func (*DateState) Release ¶
func (s *DateState) Release()
Release decrements the underlying Swift retain count.
After Release the state must not be used or passed to a view again, and a state that is currently bound into a live view must not be released; doing either leaves the view referencing a freed handle.
type FloatState ¶
type FloatState struct {
// contains filtered or unexported fields
}
FloatState is a reactive float64 state that bridges Go and SwiftUI.
func NewFloatState ¶
func NewFloatState(initial float64) *FloatState
NewFloatState creates a new reactive float64 state with the given initial value.
func (*FloatState) Release ¶
func (s *FloatState) Release()
Release decrements the underlying Swift retain count.
After Release the state must not be used or passed to a view again, and a state that is currently bound into a live view must not be released; doing either leaves the view referencing a freed handle.
func (*FloatState) Set ¶
func (s *FloatState) Set(v float64)
Set updates the float64 value, triggering SwiftUI view updates.
func (*FloatState) SetAnimated ¶
func (s *FloatState) SetAnimated(v float64)
SetAnimated updates the float64 value inside withAnimation.
func (*FloatState) SetAnimatedWith ¶
func (s *FloatState) SetAnimatedWith(v float64, kind AnimationKind)
SetAnimatedWith updates the float64 value using the provided animation curve.
type FocusNamespace ¶
type FocusNamespace struct {
// contains filtered or unexported fields
}
FocusNamespace coordinates namespace-backed focus scopes.
Bridge surface.
The zero value is not usable; call NewFocusNamespace.
func NewFocusNamespace ¶
func NewFocusNamespace() *FocusNamespace
NewFocusNamespace creates a new SwiftUI namespace handle for focus routing.
func (*FocusNamespace) Release ¶
func (ns *FocusNamespace) Release()
Release decrements the underlying Swift retain count.
type Font ¶
type Font struct {
// contains filtered or unexported fields
}
Font is an opaque handle to a SwiftUI font in the Swift bridge.
var ( FontLargeTitle Font FontTitle Font FontTitle2 Font FontTitle3 Font FontHeadline Font FontSubheadline Font FontBody Font FontCallout Font FontFootnote Font FontCaption Font FontCaption2 Font )
Preset font variables, initialized after the dylib loads.
func FontSystem ¶
FontSystem returns a system font at the given point size.
func FontSystemDesign ¶
FontSystemDesign returns a system font with explicit weight and design. Use Weight* and Design* constants for the weight and design parameters.
type Glass ¶
type Glass struct {
// contains filtered or unexported fields
}
Glass configures a Liquid Glass effect. The zero value is regular glass with no tint and default interactivity.
func GlassIdentity ¶
func GlassIdentity() Glass
GlassIdentity returns the identity Liquid Glass variant.
func GlassRegular ¶
func GlassRegular() Glass
GlassRegular returns the regular Liquid Glass variant.
func (Glass) Interactive ¶
Interactive returns a copy of g with explicit interactivity behavior.
type GlassButtonStyleKind
deprecated
type GlassButtonStyleKind int32
GlassButtonStyleKind identifies legacy glass button styles.
Deprecated: use View.GlassButtonStyle or View.GlassProminentButtonStyle.
const ( GlassButtonStyleRegular GlassButtonStyleKind = 0 GlassButtonStyleProminent GlassButtonStyleKind = 1 )
type GlassEffectTransitionKind ¶
type GlassEffectTransitionKind int32
GlassEffectTransitionKind identifies Liquid Glass transition behavior.
const ( GlassEffectTransitionIdentity GlassEffectTransitionKind = 0 GlassEffectTransitionMatchedGeometry GlassEffectTransitionKind = 1 GlassEffectTransitionMaterialize GlassEffectTransitionKind = 2 )
type GlassShape ¶
type GlassShape int32
GlassShape identifies glass effect shapes.
const ( GlassShapeDefault GlassShape = -1 GlassShapeRoundedRectangle GlassShape = 0 GlassShapeCapsule GlassShape = 1 GlassShapeCircle GlassShape = 2 )
type GlassStyle
deprecated
type GlassStyle int32
GlassStyle identifies legacy glass-style presets.
Deprecated: use Glass and GlassVariant for Liquid Glass effects.
const ( GlassStyleRegular GlassStyle = 0 GlassStyleProminent GlassStyle = 1 GlassStyleThin GlassStyle = 2 GlassStyleThick GlassStyle = 3 GlassStyleUltraThin GlassStyle = 4 )
type GlassVariant ¶
type GlassVariant int32
GlassVariant identifies Liquid Glass variants.
const ( GlassVariantRegular GlassVariant = 0 GlassVariantClear GlassVariant = 1 GlassVariantIdentity GlassVariant = 2 )
type GridItem ¶
type GridItem struct {
Kind GridItemKind
Size float64
Maximum float64
}
GridItem describes one curated grid track.
Current grid helpers use the number of items as the track count and preserve the size fields for forward-compatible API growth.
func AdaptiveGridItem ¶
AdaptiveGridItem creates an adaptive grid track.
func FixedGridItem ¶
FixedGridItem creates a fixed-width or fixed-height grid track.
func FlexibleGridItem ¶
FlexibleGridItem creates a flexible grid track with minimum and maximum sizes.
type GridItemKind ¶
type GridItemKind int
GridItemKind identifies curated grid track sizing strategies.
const ( GridItemFixed GridItemKind = iota GridItemFlexible GridItemAdaptive )
type HorizontalAlignment ¶
type HorizontalAlignment int32
HorizontalAlignment identifies horizontal alignment options.
const ( HorizontalAlignmentLeading HorizontalAlignment = 0 HorizontalAlignmentCenter HorizontalAlignment = 1 HorizontalAlignmentTrailing HorizontalAlignment = 2 )
type HoverEffectKind ¶
type HoverEffectKind int32
HoverEffectKind identifies hover effect styles.
const ( HoverEffectAutomatic HoverEffectKind = 0 HoverEffectHighlight HoverEffectKind = 1 )
type ImageScale ¶
type ImageScale int32
ImageScale identifies SF Symbol image scales.
const ( ImageScaleSmall ImageScale = 0 ImageScaleMedium ImageScale = 1 ImageScaleLarge ImageScale = 2 )
type IntState ¶
type IntState struct {
// contains filtered or unexported fields
}
IntState is a reactive integer state that bridges Go and SwiftUI. When the value changes via Set, any SwiftUI views observing this state update automatically.
func NewIntState ¶
NewIntState creates a new reactive integer state with the given initial value.
func (*IntState) Release ¶
func (s *IntState) Release()
Release decrements the underlying Swift retain count.
After Release the state must not be used or passed to a view again, and a state that is currently bound into a live view must not be released; doing either leaves the view referencing a freed handle.
func (*IntState) SetAnimated ¶
SetAnimated updates the value inside withAnimation, triggering animated SwiftUI transitions.
func (*IntState) SetAnimatedWith ¶
func (s *IntState) SetAnimatedWith(v int, kind AnimationKind)
SetAnimatedWith updates the value using the provided animation curve.
type LabelStyleKind ¶
type LabelStyleKind int32
LabelStyleKind identifies label display styles.
const ( LabelStyleAutomatic LabelStyleKind = 0 LabelStyleIconOnly LabelStyleKind = 1 LabelStyleTitleOnly LabelStyleKind = 2 LabelStyleTitleAndIcon LabelStyleKind = 3 )
type ListStyleKind ¶
type ListStyleKind int32
ListStyleKind identifies list display styles.
const ( ListStyleAutomatic ListStyleKind = 0 ListStyleSidebar ListStyleKind = 1 ListStyleInset ListStyleKind = 2 ListStylePlain ListStyleKind = 3 )
type MenuBarConfig ¶
type MenuBarConfig struct {
Label string // Text shown next to the icon
SystemImage string // SF Symbol name for the icon
Width float64 // Popover width
Height float64 // Popover height
OpenOnLaunch bool // Show the popover immediately after app launch.
Content View // Popover content; a zero View installs a status item with no popover.
}
MenuBarConfig configures a menu bar (status bar) item and its popover.
type MenuBarLabelStyle ¶
MenuBarLabelStyle controls visual behavior when updating the status label.
type MenuButtonStyleKind ¶
type MenuButtonStyleKind int32
MenuButtonStyleKind identifies menu button styles.
const ( MenuButtonStyleDefault MenuButtonStyleKind = 0 MenuButtonStylePullDown MenuButtonStyleKind = 1 MenuButtonStyleBorderlessPullDown MenuButtonStyleKind = 2 MenuButtonStyleBorderlessButton MenuButtonStyleKind = 3 MenuButtonStyleTexturedPullDown MenuButtonStyleKind = 4 )
type MenuOrderKind ¶
type MenuOrderKind int32
MenuOrderKind identifies menu ordering behavior.
const ( MenuOrderAutomatic MenuOrderKind = 0 MenuOrderFixed MenuOrderKind = 1 )
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace coordinates Liquid Glass IDs and unions. The zero value is not usable; call NewNamespace.
func NewNamespace ¶
func NewNamespace() *Namespace
NewNamespace creates a new SwiftUI namespace handle for glass effect IDs.
type NavigationSplitViewStyleKind ¶
type NavigationSplitViewStyleKind int32
NavigationSplitViewStyleKind identifies navigation split view styles.
const ( )
type NavigationSplitViewVisibilityKind ¶
type NavigationSplitViewVisibilityKind int32
NavigationSplitViewVisibilityKind identifies column visibility.
const ( )
type NavigationViewStyleKind ¶
type NavigationViewStyleKind int32
NavigationViewStyleKind identifies legacy navigation view styles.
const ( )
type OutlineNode ¶
type OutlineNode struct {
Label View
Children []OutlineNode
Expanded *BoolState
}
OutlineNode describes one node in a hierarchical outline. If Expanded is nil, child nodes are always shown.
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path is a mutable opcode builder for SwiftUI Path shapes. A Path is cheap to construct and its underlying buffer is reusable. Methods return the receiver for fluent chaining.
To get a SwiftUI View from a Path, call View. The resulting View is shape-backed, so .Fill, .Stroke, and .StrokeStyle work on it the same as on Circle, Rectangle, etc.
func (*Path) Arc ¶
Arc appends a circular arc centered at (cx, cy) with radius r, sweeping from startRadians to endRadians. If clockwise, the sweep direction is flipped.
func (*Path) Bytes ¶
Bytes returns a reference to the underlying opcode buffer. The slice is valid until the next mutation on p; callers that need to retain the bytes beyond that should copy.
func (*Path) Close ¶
Close closes the current subpath by appending a straight segment back to its starting point.
func (*Path) Cubic ¶
Cubic appends a cubic bezier segment with two control points. This is the primary building block for Sankey ribbons and curved network edges.
type PickerStyleKind ¶
type PickerStyleKind int32
PickerStyleKind identifies picker display styles.
const ( PickerStyleAutomatic PickerStyleKind = 0 PickerStyleInline PickerStyleKind = 1 PickerStyleMenu PickerStyleKind = 2 PickerStyleSegmented PickerStyleKind = 3 PickerStyleWheel PickerStyleKind = 4 PickerStylePalette PickerStyleKind = 6 )
type PointerStyleKind ¶
type PointerStyleKind int32
PointerStyleKind identifies pointer cursor styles.
const ( PointerStyleAutomatic PointerStyleKind = 0 PointerStyleLink PointerStyleKind = 1 PointerStyleCrosshair PointerStyleKind = 2 )
type PresentationDragIndicatorKind ¶
type PresentationDragIndicatorKind int32
PresentationDragIndicatorKind identifies drag indicator visibility.
const ( PresentationDragIndicatorAutomatic PresentationDragIndicatorKind = 0 PresentationDragIndicatorVisible PresentationDragIndicatorKind = 1 PresentationDragIndicatorHidden PresentationDragIndicatorKind = 2 )
type ScrollAnchor ¶
type ScrollAnchor int32
ScrollAnchor identifies scroll anchor positions.
const ( ScrollAnchorTop ScrollAnchor = 0 ScrollAnchorCenter ScrollAnchor = 1 ScrollAnchorBottom ScrollAnchor = 2 ScrollAnchorLeading ScrollAnchor = 3 ScrollAnchorTrailing ScrollAnchor = 4 )
type ScrollBounce ¶
type ScrollBounce int32
ScrollBounce identifies scroll bounce behavior.
const ( ScrollBounceBasedOnSize ScrollBounce = 0 ScrollBounceAlways ScrollBounce = 1 ScrollBounceAutomatic ScrollBounce = 2 )
type ScrollTargetBehaviorKind ¶
type ScrollTargetBehaviorKind int32
ScrollTargetBehaviorKind identifies scroll target snapping behavior.
const ( ScrollTargetBehaviorPaging ScrollTargetBehaviorKind = 0 ScrollTargetBehaviorViewAligned ScrollTargetBehaviorKind = 1 )
type SettingsConfig ¶
type SettingsConfig struct {
Title string
Width float64
Height float64
Root View // The settings view.
}
SettingsConfig configures the standard Settings window, opened from the app menu (Cmd-,). Presenting Settings routes the app through the scene runner.
type ShapeView ¶
type ShapeView struct {
View
}
ShapeView is a View created from a shape constructor (Circle, Rectangle, etc.). It provides shape-specific modifiers like Fill and Stroke in addition to all universal View modifiers.
func Rectangle ¶
func Rectangle() ShapeView
Rectangle creates a rectangle shape filling available space.
func RoundedRectangle ¶
RoundedRectangle creates a rounded rectangle shape.
func (ShapeView) AccessibilityHidden ¶
AccessibilityHidden hides the view from accessibility features.
func (ShapeView) AccessibilityHint ¶
AccessibilityHint sets the accessibility hint for the view.
func (ShapeView) AccessibilityIdentifier ¶
AccessibilityIdentifier sets the accessibility identifier for the view.
func (ShapeView) AccessibilityLabel ¶
AccessibilityLabel sets the accessibility label for the view.
func (ShapeView) AccessibilityRotorJSON ¶
AccessibilityRotorJSON applies a normalized accessibility rotor payload.
func (ShapeView) AccessibilityValue ¶
AccessibilityValue sets accessibility value text for the view.
func (ShapeView) AlertPresented ¶
AlertPresented presents an alert dialog while the BoolState is true.
func (ShapeView) AllowsHitTesting ¶
AllowsHitTesting controls whether the view receives hit-test events.
func (ShapeView) Animation ¶
func (v ShapeView) Animation(kind AnimationKind) ShapeView
Animation applies an animation curve to the view.
func (ShapeView) AnimationCurve ¶
func (v ShapeView) AnimationCurve(kind AnimationKind, duration float64) ShapeView
AnimationCurve applies a named animation curve with an explicit duration in seconds. Pass 0 to use SwiftUI's default duration. Duration is ignored for spring and bouncy curves.
func (ShapeView) AspectRatio ¶
func (v ShapeView) AspectRatio(ratio float64, contentMode ContentMode) ShapeView
AspectRatio constrains the view to the given aspect ratio. ContentMode: 0=fit, 1=fill.
func (ShapeView) Background ¶
Background sets a background color.
func (ShapeView) BackgroundRoundedRect ¶
BackgroundRoundedRect sets a rounded rectangle background.
func (ShapeView) BackgroundStyle ¶
BackgroundStyle sets a named background style (e.g. "regularMaterial", "windowBackground").
func (ShapeView) ButtonStyle ¶
func (v ShapeView) ButtonStyle(style ButtonStyleKind) ShapeView
ButtonStyle sets the button style for the view hierarchy.
func (ShapeView) ClipRoundedRect ¶
ClipRoundedRect clips the view to a rounded rectangle.
func (ShapeView) Collapsible ¶
Collapsible controls whether a section is collapsible.
func (ShapeView) ConfirmationDialog ¶
ConfirmationDialog presents a confirmation dialog with custom actions when the IntState is nonzero.
func (ShapeView) ConfirmationDialogPresented ¶
func (v ShapeView) ConfirmationDialogPresented(title string, state *BoolState, actions Viewable) ShapeView
ConfirmationDialogPresented presents a confirmation dialog while the BoolState is true.
func (ShapeView) ContentShapeRectangle ¶
ContentShapeRectangle makes the view hit-test as a rectangle.
func (ShapeView) ContextMenu ¶
ContextMenu adds a right-click context menu to the view.
func (ShapeView) ControlSize ¶
func (v ShapeView) ControlSize(size ControlSize) ShapeView
ControlSize sets the control size for the view hierarchy.
func (ShapeView) CornerRadius ¶
CornerRadius clips the view to a rounded rectangle.
func (ShapeView) DefaultScrollAnchor ¶
func (v ShapeView) DefaultScrollAnchor(anchor ScrollAnchor) ShapeView
DefaultScrollAnchor sets the default anchor used when a scroll view chooses an initial target.
func (ShapeView) DraggableFileURL ¶
DraggableFileURL makes a view draggable with a file URL payload.
func (ShapeView) DraggableText ¶
DraggableText makes a view draggable with a string payload.
func (ShapeView) DraggableURL ¶
DraggableURL makes a view draggable with a URL payload.
func (ShapeView) DropDestinationFileURL ¶
DropDestinationFileURL accepts dropped file URL payloads.
func (ShapeView) DropDestinationText ¶
DropDestinationText accepts dropped text payloads.
func (ShapeView) DropDestinationURL ¶
DropDestinationURL accepts dropped URL payloads.
func (ShapeView) FixedSizeAxis ¶
FixedSizeAxis prevents expansion along specific axes.
func (ShapeView) FontDesign ¶
FontDesign sets the font design for text in the view.
func (ShapeView) FontWeight ¶
FontWeight sets the font weight for text in the view.
func (ShapeView) ForegroundStyle ¶
ForegroundStyle sets the foreground color.
func (ShapeView) ForegroundStyleNamed ¶
ForegroundStyleNamed sets a named foreground style (primary, secondary, tertiary, quaternary).
func (ShapeView) FullScreenCover ¶
FullScreenCover presents a full-screen modal when the IntState is nonzero.
func (ShapeView) FullScreenCoverPresented ¶
FullScreenCoverPresented presents a full-screen modal while the BoolState is true.
func (ShapeView) ImageScale ¶
func (v ShapeView) ImageScale(scale ImageScale) ShapeView
ImageScale sets the scale for SF Symbol images.
func (ShapeView) IsDetailLink ¶
IsDetailLink marks a navigation link as a detail link.
func (ShapeView) KeyboardShortcut ¶
func (v ShapeView) KeyboardShortcut(key string, modifiers ShortcutModifier) ShapeView
KeyboardShortcut binds a keyboard shortcut to a control.
func (ShapeView) LabelsHidden ¶
LabelsHidden hides labels for controls that support label presentation.
func (ShapeView) LayoutPriority ¶
LayoutPriority sets the layout priority for this view.
func (ShapeView) ListRowBackground ¶
ListRowBackground sets a custom background for a list row.
func (ShapeView) ListStyle ¶
func (v ShapeView) ListStyle(style ListStyleKind) ShapeView
ListStyle sets the list display style.
func (ShapeView) MaxFrame ¶
MaxFrame sets maximum width/height constraints. Use FrameInfinity (-1) for .infinity, FrameUnset (0) for nil.
func (ShapeView) MenuButtonStyle ¶
func (v ShapeView) MenuButtonStyle(style MenuButtonStyleKind) ShapeView
MenuButtonStyle sets the menu button style for the view hierarchy.
func (ShapeView) NavigationSplitViewStyle ¶
func (v ShapeView) NavigationSplitViewStyle(style NavigationSplitViewStyleKind) ShapeView
NavigationSplitViewStyle sets the split view column presentation style.
func (ShapeView) NavigationTitle ¶
NavigationTitle sets the navigation title for the view.
func (ShapeView) NavigationViewStyle ¶
func (v ShapeView) NavigationViewStyle(style NavigationViewStyleKind) ShapeView
NavigationViewStyle sets the legacy navigation view style.
func (ShapeView) OnDisappear ¶
OnDisappear adds an action to perform when the view disappears.
func (ShapeView) OnHover ¶
OnHover adds a hover callback. The callback fires when hover state changes.
func (ShapeView) OnHoverLocation ¶
OnHoverLocation adds a hover callback that reports phase and local pointer coordinates.
func (ShapeView) OnHoverPhase ¶
OnHoverPhase adds a hover callback that reports whether the pointer is inside the view.
func (ShapeView) OnTapGesture ¶
OnTapGesture adds a tap gesture handler to the view.
func (ShapeView) OnTapGestureCount ¶
OnTapGestureCount adds a tap gesture handler that requires the given number of taps. Use 1 for single-tap (equivalent to OnTapGesture), 2 for double-click.
func (ShapeView) PaddingEdge ¶
PaddingEdge applies padding to specific edges.
func (ShapeView) PointerStyle ¶
func (v ShapeView) PointerStyle(style PointerStyleKind) ShapeView
PointerStyle sets the pointer cursor style for the view.
func (ShapeView) PopoverPresented ¶
PopoverPresented presents a popover while the BoolState is true.
func (ShapeView) Refreshable ¶
Refreshable adds a native refresh action to the view.
func (ShapeView) RotationEffect ¶
RotationEffect rotates the view by the given angle in degrees.
func (ShapeView) SafeAreaInset ¶
SafeAreaInset attaches content to one edge of the safe area with explicit spacing.
func (ShapeView) ScaleEffect ¶
ScaleEffect scales the view uniformly.
func (ShapeView) ScaleEffectAt ¶
ScaleEffectAt scales the view around a specific anchor point.
func (ShapeView) ScrollBounceBehavior ¶
func (v ShapeView) ScrollBounceBehavior(behavior ScrollBounce, axis Axis) ShapeView
ScrollBounceBehavior sets the bounce policy for a scroll view along one axis.
func (ShapeView) ScrollContentBackgroundHidden ¶
ScrollContentBackgroundHidden hides the native scroll content background for scroll-backed controls such as TextEditor so callers can provide explicit chrome.
func (ShapeView) ScrollTargetBehavior ¶
func (v ShapeView) ScrollTargetBehavior(behavior ScrollTargetBehaviorKind) ShapeView
ScrollTargetBehavior sets how a scroll view snaps to its scroll targets.
func (ShapeView) ScrollTargetLayout ¶
ScrollTargetLayout marks a layout container as providing scroll targets.
func (ShapeView) Searchable ¶
func (v ShapeView) Searchable(query *StringState, prompt string) ShapeView
Searchable adds a search field bound to a StringState.
func (ShapeView) SheetPresented ¶
SheetPresented presents a modal sheet while the BoolState is true.
func (ShapeView) StrokeStyle ¶
StrokeStyle outlines the shape with the given color, line width, and dash pattern. dash is a sequence of on/off lengths in points; pass nil for a solid outline. Only the first 255 dash segments are honored.
Complements ShapeView.Stroke, which is kept for back-compat; prefer StrokeStyle when a dash pattern is needed.
func (ShapeView) SubmitLabel ¶
func (v ShapeView) SubmitLabel(label SubmitLabelKind) ShapeView
SubmitLabel sets the submit label for text input controls.
func (ShapeView) TextFieldStyle ¶
func (v ShapeView) TextFieldStyle(style TextFieldStyleKind) ShapeView
TextFieldStyle sets the style for text fields.
func (ShapeView) ToggleStyle ¶
func (v ShapeView) ToggleStyle(style ToggleStyleKind) ShapeView
ToggleStyle sets the toggle style for the view hierarchy.
func (ShapeView) ToolbarItem ¶
func (v ShapeView) ToolbarItem(placement ToolbarItemPlacement, content Viewable) ShapeView
ToolbarItem adds a single toolbar item with the given placement.
func (ShapeView) ToolbarRole ¶
func (v ShapeView) ToolbarRole(role ToolbarRole) ShapeView
ToolbarRole sets the semantic toolbar role for the view hierarchy.
func (ShapeView) WebViewBackForwardNavigationGestures ¶
func (v ShapeView) WebViewBackForwardNavigationGestures(behavior WebViewBehavior) ShapeView
WebViewBackForwardNavigationGestures controls web view back/forward gesture behavior.
func (ShapeView) WebViewContentBackground ¶
func (v ShapeView) WebViewContentBackground(visibility WebViewContentBackgroundVisibility) ShapeView
WebViewContentBackground controls visibility of the web view content background.
func (ShapeView) WebViewElementFullscreenBehavior ¶
func (v ShapeView) WebViewElementFullscreenBehavior(behavior WebViewBehavior) ShapeView
WebViewElementFullscreenBehavior controls full-screen behavior for web page elements.
func (ShapeView) WebViewLinkPreviews ¶
func (v ShapeView) WebViewLinkPreviews(behavior WebViewBehavior) ShapeView
WebViewLinkPreviews controls whether link previews are shown.
func (ShapeView) WebViewMagnificationGestures ¶
func (v ShapeView) WebViewMagnificationGestures(behavior WebViewBehavior) ShapeView
WebViewMagnificationGestures controls magnification gesture behavior.
func (ShapeView) WebViewTextSelection ¶
WebViewTextSelection enables or disables text selection in the web view.
type ShortcutModifier ¶
type ShortcutModifier int32
ShortcutModifier identifies keyboard shortcut modifier keys.
const ( ShortcutModifierCommand ShortcutModifier = 1 ShortcutModifierShift ShortcutModifier = 2 ShortcutModifierOption ShortcutModifier = 4 ShortcutModifierControl ShortcutModifier = 8 )
type StringState ¶
type StringState struct {
// contains filtered or unexported fields
}
StringState is a reactive string state that bridges Go and SwiftUI.
func NewStringState ¶
func NewStringState(initial string) *StringState
NewStringState creates a new reactive string state with the given initial value.
func (*StringState) Release ¶
func (s *StringState) Release()
Release decrements the underlying Swift retain count.
After Release the state must not be used or passed to a view again, and a state that is currently bound into a live view must not be released; doing either leaves the view referencing a freed handle.
func (*StringState) Set ¶
func (s *StringState) Set(v string)
Set updates the string value, triggering SwiftUI view updates.
type SubmitLabelKind ¶
type SubmitLabelKind int32
SubmitLabelKind identifies submit label presets.
const ( SubmitLabelReturn SubmitLabelKind = 0 SubmitLabelDone SubmitLabelKind = 1 SubmitLabelGo SubmitLabelKind = 2 SubmitLabelSend SubmitLabelKind = 3 SubmitLabelJoin SubmitLabelKind = 4 SubmitLabelContinue SubmitLabelKind = 5 SubmitLabelNext SubmitLabelKind = 6 SubmitLabelSearch SubmitLabelKind = 7 SubmitLabelRoute SubmitLabelKind = 8 )
type SymbolRenderingMode ¶
type SymbolRenderingMode int32
SymbolRenderingMode identifies SF Symbol rendering modes.
const ( SymbolRenderingModeMonochrome SymbolRenderingMode = 0 SymbolRenderingModeHierarchical SymbolRenderingMode = 1 SymbolRenderingModePalette SymbolRenderingMode = 2 SymbolRenderingModeMulticolor SymbolRenderingMode = 3 )
type TableColumnSpec ¶
TableColumnSpec describes one column in a table-style layout.
func TableColumn ¶
func TableColumn(header View, cell func(row int) View) TableColumnSpec
TableColumn constructs a table column specification.
type TextAlignment ¶
type TextAlignment int32
TextAlignment identifies multiline text alignment.
const ( TextAlignmentLeading TextAlignment = 0 TextAlignmentCenter TextAlignment = 1 TextAlignmentTrailing TextAlignment = 2 )
type TextFieldStyleKind ¶
type TextFieldStyleKind int32
TextFieldStyleKind identifies text field display styles.
const ( TextFieldStyleAutomatic TextFieldStyleKind = 0 TextFieldStyleRoundedBorder TextFieldStyleKind = 1 TextFieldStylePlain TextFieldStyleKind = 2 )
type TextSelectionState ¶
type TextSelectionState struct {
// contains filtered or unexported fields
}
TextSelectionState is a reactive UTF-16 text selection range.
func NewTextSelectionState ¶
func NewTextSelectionState(start, end int) *TextSelectionState
NewTextSelectionState creates a new reactive UTF-16 text selection range.
func (*TextSelectionState) End ¶
func (s *TextSelectionState) End() int
End returns the current UTF-16 selection end offset.
func (*TextSelectionState) Release ¶
func (s *TextSelectionState) Release()
Release decrements the underlying Swift retain count.
After Release the state must not be used or passed to a view again, and a state that is currently bound into a live view must not be released; doing either leaves the view referencing a freed handle.
func (*TextSelectionState) Set ¶
func (s *TextSelectionState) Set(start, end int)
Set updates the UTF-16 selection range.
func (*TextSelectionState) Start ¶
func (s *TextSelectionState) Start() int
Start returns the current UTF-16 selection start offset.
type TextView ¶
type TextView struct {
View
}
TextView is a View created from a text constructor (Text, Label, etc.). It provides text-specific modifiers like Bold, Italic, and Font in addition to all universal View modifiers.
func TextFromString ¶
func TextFromString(state *StringState) TextView
TextFromString creates a text view that reactively displays a StringState value.
func TextTimerInterval ¶
func TextTimerInterval(start float64, end float64, pauseTime float64, countsDown bool, showsHours bool) TextView
TextTimerInterval creates a timer text view from Unix epoch seconds; pass 0 for pauseTime to omit it.
func (TextView) AccessibilityHidden ¶
AccessibilityHidden hides the view from accessibility features.
func (TextView) AccessibilityHint ¶
AccessibilityHint sets the accessibility hint for the view.
func (TextView) AccessibilityIdentifier ¶
AccessibilityIdentifier sets the accessibility identifier for the view.
func (TextView) AccessibilityLabel ¶
AccessibilityLabel sets the accessibility label for the view.
func (TextView) AccessibilityRotorJSON ¶
AccessibilityRotorJSON applies a normalized accessibility rotor payload.
func (TextView) AccessibilityValue ¶
AccessibilityValue sets accessibility value text for the view.
func (TextView) AlertPresented ¶
AlertPresented presents an alert dialog while the BoolState is true.
func (TextView) AllowsHitTesting ¶
AllowsHitTesting controls whether the view receives hit-test events.
func (TextView) Animation ¶
func (v TextView) Animation(kind AnimationKind) TextView
Animation applies an animation curve to the view.
func (TextView) AnimationCurve ¶
func (v TextView) AnimationCurve(kind AnimationKind, duration float64) TextView
AnimationCurve applies a named animation curve with an explicit duration in seconds. Pass 0 to use SwiftUI's default duration. Duration is ignored for spring and bouncy curves.
func (TextView) AspectRatio ¶
func (v TextView) AspectRatio(ratio float64, contentMode ContentMode) TextView
AspectRatio constrains the view to the given aspect ratio. ContentMode: 0=fit, 1=fill.
func (TextView) Background ¶
Background sets a background color.
func (TextView) BackgroundRoundedRect ¶
BackgroundRoundedRect sets a rounded rectangle background.
func (TextView) BackgroundStyle ¶
BackgroundStyle sets a named background style (e.g. "regularMaterial", "windowBackground").
func (TextView) ButtonStyle ¶
func (v TextView) ButtonStyle(style ButtonStyleKind) TextView
ButtonStyle sets the button style for the view hierarchy.
func (TextView) ClipRoundedRect ¶
ClipRoundedRect clips the view to a rounded rectangle.
func (TextView) Collapsible ¶
Collapsible controls whether a section is collapsible.
func (TextView) ConfirmationDialog ¶
ConfirmationDialog presents a confirmation dialog with custom actions when the IntState is nonzero.
func (TextView) ConfirmationDialogPresented ¶
func (v TextView) ConfirmationDialogPresented(title string, state *BoolState, actions Viewable) TextView
ConfirmationDialogPresented presents a confirmation dialog while the BoolState is true.
func (TextView) ContentShapeRectangle ¶
ContentShapeRectangle makes the view hit-test as a rectangle.
func (TextView) ContextMenu ¶
ContextMenu adds a right-click context menu to the view.
func (TextView) ControlSize ¶
func (v TextView) ControlSize(size ControlSize) TextView
ControlSize sets the control size for the view hierarchy.
func (TextView) CornerRadius ¶
CornerRadius clips the view to a rounded rectangle.
func (TextView) DefaultScrollAnchor ¶
func (v TextView) DefaultScrollAnchor(anchor ScrollAnchor) TextView
DefaultScrollAnchor sets the default anchor used when a scroll view chooses an initial target.
func (TextView) DraggableFileURL ¶
DraggableFileURL makes a view draggable with a file URL payload.
func (TextView) DraggableText ¶
DraggableText makes a view draggable with a string payload.
func (TextView) DraggableURL ¶
DraggableURL makes a view draggable with a URL payload.
func (TextView) DropDestinationFileURL ¶
DropDestinationFileURL accepts dropped file URL payloads.
func (TextView) DropDestinationText ¶
DropDestinationText accepts dropped text payloads.
func (TextView) DropDestinationURL ¶
DropDestinationURL accepts dropped URL payloads.
func (TextView) FixedSizeAxis ¶
FixedSizeAxis prevents expansion along specific axes.
func (TextView) FontDesign ¶
FontDesign sets the font design for text in the view.
func (TextView) FontWeight ¶
FontWeight sets the font weight for text in the view.
func (TextView) ForegroundStyle ¶
ForegroundStyle sets the foreground color.
func (TextView) ForegroundStyleNamed ¶
ForegroundStyleNamed sets a named foreground style (primary, secondary, tertiary, quaternary).
func (TextView) FullScreenCover ¶
FullScreenCover presents a full-screen modal when the IntState is nonzero.
func (TextView) FullScreenCoverPresented ¶
FullScreenCoverPresented presents a full-screen modal while the BoolState is true.
func (TextView) ImageScale ¶
func (v TextView) ImageScale(scale ImageScale) TextView
ImageScale sets the scale for SF Symbol images.
func (TextView) IsDetailLink ¶
IsDetailLink marks a navigation link as a detail link.
func (TextView) KeyboardShortcut ¶
func (v TextView) KeyboardShortcut(key string, modifiers ShortcutModifier) TextView
KeyboardShortcut binds a keyboard shortcut to a control.
func (TextView) LabelsHidden ¶
LabelsHidden hides labels for controls that support label presentation.
func (TextView) LayoutPriority ¶
LayoutPriority sets the layout priority for this view.
func (TextView) LineLimit ¶
LineLimit sets the maximum number of lines for text views. The sentinel n == 0 means unlimited (no line limit); any positive n caps the line count.
func (TextView) ListRowBackground ¶
ListRowBackground sets a custom background for a list row.
func (TextView) ListStyle ¶
func (v TextView) ListStyle(style ListStyleKind) TextView
ListStyle sets the list display style.
func (TextView) MaxFrame ¶
MaxFrame sets maximum width/height constraints. Use FrameInfinity (-1) for .infinity, FrameUnset (0) for nil.
func (TextView) MenuButtonStyle ¶
func (v TextView) MenuButtonStyle(style MenuButtonStyleKind) TextView
MenuButtonStyle sets the menu button style for the view hierarchy.
func (TextView) MonospacedDigit ¶
MonospacedDigit applies monospaced digit formatting.
func (TextView) MultilineTextAlignment ¶
func (v TextView) MultilineTextAlignment(alignment TextAlignment) TextView
MultilineTextAlignment sets the alignment for multiline text.
func (TextView) NavigationSplitViewStyle ¶
func (v TextView) NavigationSplitViewStyle(style NavigationSplitViewStyleKind) TextView
NavigationSplitViewStyle sets the split view column presentation style.
func (TextView) NavigationTitle ¶
NavigationTitle sets the navigation title for the view.
func (TextView) NavigationViewStyle ¶
func (v TextView) NavigationViewStyle(style NavigationViewStyleKind) TextView
NavigationViewStyle sets the legacy navigation view style.
func (TextView) OnDisappear ¶
OnDisappear adds an action to perform when the view disappears.
func (TextView) OnHover ¶
OnHover adds a hover callback. The callback fires when hover state changes.
func (TextView) OnHoverLocation ¶
OnHoverLocation adds a hover callback that reports phase and local pointer coordinates.
func (TextView) OnHoverPhase ¶
OnHoverPhase adds a hover callback that reports whether the pointer is inside the view.
func (TextView) OnTapGesture ¶
OnTapGesture adds a tap gesture handler to the view.
func (TextView) OnTapGestureCount ¶
OnTapGestureCount adds a tap gesture handler that requires the given number of taps. Use 1 for single-tap (equivalent to OnTapGesture), 2 for double-click.
func (TextView) PaddingEdge ¶
PaddingEdge applies padding to specific edges.
func (TextView) PointerStyle ¶
func (v TextView) PointerStyle(style PointerStyleKind) TextView
PointerStyle sets the pointer cursor style for the view.
func (TextView) PopoverPresented ¶
PopoverPresented presents a popover while the BoolState is true.
func (TextView) Refreshable ¶
Refreshable adds a native refresh action to the view.
func (TextView) RotationEffect ¶
RotationEffect rotates the view by the given angle in degrees.
func (TextView) SafeAreaInset ¶
SafeAreaInset attaches content to one edge of the safe area with explicit spacing.
func (TextView) ScaleEffect ¶
ScaleEffect scales the view uniformly.
func (TextView) ScaleEffectAt ¶
ScaleEffectAt scales the view around a specific anchor point.
func (TextView) ScrollBounceBehavior ¶
func (v TextView) ScrollBounceBehavior(behavior ScrollBounce, axis Axis) TextView
ScrollBounceBehavior sets the bounce policy for a scroll view along one axis.
func (TextView) ScrollContentBackgroundHidden ¶
ScrollContentBackgroundHidden hides the native scroll content background for scroll-backed controls such as TextEditor so callers can provide explicit chrome.
func (TextView) ScrollTargetBehavior ¶
func (v TextView) ScrollTargetBehavior(behavior ScrollTargetBehaviorKind) TextView
ScrollTargetBehavior sets how a scroll view snaps to its scroll targets.
func (TextView) ScrollTargetLayout ¶
ScrollTargetLayout marks a layout container as providing scroll targets.
func (TextView) Searchable ¶
func (v TextView) Searchable(query *StringState, prompt string) TextView
Searchable adds a search field bound to a StringState.
func (TextView) SheetPresented ¶
SheetPresented presents a modal sheet while the BoolState is true.
func (TextView) Strikethrough ¶
Strikethrough adds a strikethrough to text in the view.
func (TextView) SubmitLabel ¶
func (v TextView) SubmitLabel(label SubmitLabelKind) TextView
SubmitLabel sets the submit label for text input controls.
func (TextView) SymbolRenderingMode ¶
func (v TextView) SymbolRenderingMode(mode SymbolRenderingMode) TextView
SymbolRenderingMode sets the rendering mode for SF Symbols.
func (TextView) TextFieldStyle ¶
func (v TextView) TextFieldStyle(style TextFieldStyleKind) TextView
TextFieldStyle sets the style for text fields.
func (TextView) ToggleStyle ¶
func (v TextView) ToggleStyle(style ToggleStyleKind) TextView
ToggleStyle sets the toggle style for the view hierarchy.
func (TextView) ToolbarItem ¶
func (v TextView) ToolbarItem(placement ToolbarItemPlacement, content Viewable) TextView
ToolbarItem adds a single toolbar item with the given placement.
func (TextView) ToolbarRole ¶
func (v TextView) ToolbarRole(role ToolbarRole) TextView
ToolbarRole sets the semantic toolbar role for the view hierarchy.
func (TextView) TruncationMode ¶
func (v TextView) TruncationMode(mode TruncationMode) TextView
TruncationMode sets how text is truncated when it overflows.
func (TextView) WebViewBackForwardNavigationGestures ¶
func (v TextView) WebViewBackForwardNavigationGestures(behavior WebViewBehavior) TextView
WebViewBackForwardNavigationGestures controls web view back/forward gesture behavior.
func (TextView) WebViewContentBackground ¶
func (v TextView) WebViewContentBackground(visibility WebViewContentBackgroundVisibility) TextView
WebViewContentBackground controls visibility of the web view content background.
func (TextView) WebViewElementFullscreenBehavior ¶
func (v TextView) WebViewElementFullscreenBehavior(behavior WebViewBehavior) TextView
WebViewElementFullscreenBehavior controls full-screen behavior for web page elements.
func (TextView) WebViewLinkPreviews ¶
func (v TextView) WebViewLinkPreviews(behavior WebViewBehavior) TextView
WebViewLinkPreviews controls whether link previews are shown.
func (TextView) WebViewMagnificationGestures ¶
func (v TextView) WebViewMagnificationGestures(behavior WebViewBehavior) TextView
WebViewMagnificationGestures controls magnification gesture behavior.
func (TextView) WebViewTextSelection ¶
WebViewTextSelection enables or disables text selection in the web view.
type ToggleStyleKind ¶
type ToggleStyleKind int32
ToggleStyleKind identifies toggle display styles.
const ( ToggleStyleAutomatic ToggleStyleKind = 0 ToggleStyleButton ToggleStyleKind = 1 ToggleStyleCheckbox ToggleStyleKind = 2 ToggleStyleSwitch ToggleStyleKind = 3 )
type ToolbarItemPlacement ¶
type ToolbarItemPlacement int32
ToolbarItemPlacement identifies toolbar item positions.
const ( ToolbarItemPlacementAutomatic ToolbarItemPlacement = 0 ToolbarItemPlacementPrincipal ToolbarItemPlacement = 1 ToolbarItemPlacementPrimaryAction ToolbarItemPlacement = 3 ToolbarItemPlacementSecondaryAction ToolbarItemPlacement = 4 ToolbarItemPlacementCancellationAction ToolbarItemPlacement = 5 ToolbarItemPlacementConfirmationAction ToolbarItemPlacement = 6 ToolbarItemPlacementDestructiveAction ToolbarItemPlacement = 7 ToolbarItemPlacementStatus ToolbarItemPlacement = 8 )
type ToolbarRole ¶
type ToolbarRole int32
ToolbarRole identifies toolbar roles.
const ( ToolbarRoleAutomatic ToolbarRole = 0 ToolbarRoleEditor ToolbarRole = 1 )
type Transition ¶
type Transition int32
Transition identifies view transition animations.
const ( TransitionSlide Transition = 0 TransitionOpacity Transition = 1 TransitionMove Transition = 2 TransitionScale Transition = 3 TransitionPush Transition = 4 )
type TruncationMode ¶
type TruncationMode int32
TruncationMode identifies text truncation behavior.
const ( TruncationModeHead TruncationMode = 0 TruncationModeMiddle TruncationMode = 1 TruncationModeTail TruncationMode = 2 )
type UnitPoint ¶
type UnitPoint struct {
X, Y float64
}
UnitPoint identifies a normalized point in a view rectangle.
type VerticalAlignment ¶
type VerticalAlignment int32
VerticalAlignment identifies vertical alignment options.
const ( VerticalAlignmentTop VerticalAlignment = 0 VerticalAlignmentCenter VerticalAlignment = 1 VerticalAlignmentBottom VerticalAlignment = 2 VerticalAlignmentFirstTextBaseline VerticalAlignment = 3 VerticalAlignmentLastTextBaseline VerticalAlignment = 4 )
type View ¶
type View struct {
// contains filtered or unexported fields
}
View is an opaque handle to a SwiftUI view in the Swift bridge.
func AnimatedDynamicBoolView ¶
func AnimatedDynamicBoolView(state *BoolState, transition Transition, builder func(value bool) View) View
AnimatedDynamicBoolView creates a BoolState-driven view with animated transitions.
func AnimatedDynamicFloatView ¶
func AnimatedDynamicFloatView(state *FloatState, transition Transition, builder func(value float64) View) View
AnimatedDynamicFloatView creates a FloatState-driven view with animated transitions.
func AnimatedDynamicView ¶
func AnimatedDynamicView(state *IntState, transition Transition, builder func(value int) View) View
AnimatedDynamicView creates a view with animated transitions between states.
func AsyncImage ¶
AsyncImage loads and displays an image from a URL.
func ButtonView ¶
ButtonView creates a clickable button using a custom label view.
func ButtonWithImage ¶
ButtonWithImage creates a clickable button with an SF Symbol icon.
func ButtonWithLabel ¶
ButtonWithLabel creates a clickable button with both text and an SF Symbol icon.
func Canvas ¶
func Canvas(state *CanvasState, width, height float64) View
Canvas returns a SwiftUI Canvas view bound to the given state with the given pixel dimensions. The Canvas re-renders whenever state.Set is called with a new opcode blob.
func ColorPicker ¶
func ColorPicker(label string, state *ColorState, onChange func()) View
ColorPicker creates a color picker bound to a ColorState.
func DatePicker ¶
DatePicker creates a date picker bound to a DateState.
func DisclosureGroupView ¶
DisclosureGroupView creates a disclosure group with a custom label view and BoolState-backed expansion state.
func DynamicBoolView ¶
DynamicBoolView creates a view whose content is rebuilt by a Go callback whenever the observed BoolState changes.
func DynamicFloatView ¶
func DynamicFloatView(state *FloatState, builder func(value float64) View) View
DynamicFloatView creates a view whose content is rebuilt by a Go callback whenever the observed FloatState changes.
func DynamicView ¶
DynamicView creates a view whose content is rebuilt by a Go callback whenever the observed IntState changes.
func FloatGauge ¶
func FloatGauge(label string, state *FloatState, min float64, max float64) View
FloatGauge displays a gauge bound to a FloatState. As a reactive Float* variant the arguments are label first, then the bound state and range; the static Gauge takes value first because it has no bound state.
func FloatProgressView ¶
func FloatProgressView(state *FloatState, total float64) View
FloatProgressView displays a progress bar bound to a FloatState.
func FloatSlider ¶
func FloatSlider(label string, state *FloatState, min float64, max float64, onChange func()) View
FloatSlider creates a slider bound to a FloatState within a range.
func Gauge ¶
Gauge displays a static value within a range. For a Gauge bound to reactive state, use FloatGauge. Naming rule: the Float* prefix marks the reactive (*FloatState-bound) variant of an otherwise static view; reactive variants take the label first followed by the bound state.
func GeometryReader ¶
GeometryReader creates a view whose content is built with the available width and height.
func GlassEffectContainer ¶
GlassEffectContainer groups Liquid Glass effects so SwiftUI can blend and morph them together.
func GlassEffectContainerSpaced ¶
GlassEffectContainerSpaced groups Liquid Glass effects with explicit container spacing.
func HStackAligned ¶
func HStackAligned(alignment VerticalAlignment, children ...Viewable) View
HStackAligned arranges child views in a horizontal stack with explicit vertical alignment.
func HStackAlignedSpaced ¶
func HStackAlignedSpaced(alignment VerticalAlignment, spacing float64, children ...Viewable) View
HStackAlignedSpaced arranges child views in a horizontal stack with explicit alignment and spacing.
func HStackSpaced ¶
HStackSpaced arranges child views in a horizontal stack with explicit spacing.
func ImageFromFile ¶
ImageFromFile creates an image view from a file path.
func ImageNamed ¶
ImageNamed creates an image view from a named image resource in the asset catalog.
func LazyHGrid ¶
LazyHGrid arranges child views into a horizontal grid using the provided row count.
func LazyHStack ¶
LazyHStack arranges child views in a horizontal stack with lazy rendering.
func LazyVGrid ¶
LazyVGrid arranges child views into a vertical grid using the provided column count.
func LazyVStack ¶
LazyVStack arranges child views in a vertical stack with lazy rendering.
func LinearGradient ¶
LinearGradient creates a two-stop linear gradient view.
func LinearGradientHorizontal ¶
LinearGradientHorizontal creates a leading-to-trailing two-stop linear gradient view.
func LinearGradientVertical ¶
LinearGradientVertical creates a top-to-bottom two-stop linear gradient view.
func MeshGradient4 ¶
MeshGradient4 creates a four-corner mesh gradient view.
func NavigationLink ¶
NavigationLink creates a link to a destination view within a NavigationStack.
func NavigationSplitView ¶
NavigationSplitView presents sidebar and detail content in a split navigation interface.
func NavigationSplitViewTriple ¶
NavigationSplitViewTriple presents sidebar, content, and detail columns in a split navigation interface.
func NavigationSplitViewTripleVisibility ¶
func NavigationSplitViewTripleVisibility(visibility *IntState, sidebar Viewable, content Viewable, detail Viewable) View
NavigationSplitViewTripleVisibility presents three columns with IntState-backed column visibility.
func NavigationSplitViewVisibility ¶
NavigationSplitViewVisibility presents sidebar and detail content with IntState-backed column visibility.
func NavigationStack ¶
NavigationStack wraps content in a navigation container.
func OutlineGroup ¶
func OutlineGroup(nodes ...OutlineNode) View
OutlineGroup builds a hierarchical outline from custom label views.
func PasteButton ¶
func PasteButton(label string, state *StringState) View
PasteButton inserts the current plain-text clipboard string into a StringState when pressed.
func PhaseAnimator ¶
func PhaseAnimator(phases []int32, content func(value int) View, animation AnimationKind) View
PhaseAnimator creates a phase-driven view sequence.
func PhaseAnimatorTrigger ¶
func PhaseAnimatorTrigger(phases []int32, trigger int32, content func(value int) View, animation AnimationKind) View
PhaseAnimatorTrigger creates a phase-driven view sequence that restarts when trigger changes.
func PickerMenu ¶
PickerMenu creates a dropdown menu picker bound to an IntState.
func PickerSegmented ¶
PickerSegmented creates a segmented picker bound to an IntState.
func ProgressLinear ¶
ProgressLinear creates a determinate linear progress indicator.
func ProgressSpinning ¶
func ProgressSpinning() View
ProgressSpinning creates an indeterminate spinning progress indicator.
func RadialGradient ¶
RadialGradient creates a two-stop radial gradient view.
func ScrollView ¶
ScrollView wraps content in a vertically scrollable container.
func ScrollViewReader ¶
func ScrollViewReader(position *IntState, anchor ScrollAnchor, content Viewable) View
ScrollViewReader wraps content with IntState-backed programmatic scrolling. Tag descendants with ID; position 0 means no scroll target.
func SectionExpanded ¶
SectionExpanded groups content with a header label and a BoolState-backed disclosure state.
func SectionExpandedView ¶
SectionExpandedView groups content with a custom header view and a BoolState-backed disclosure state.
func SecureField ¶
func SecureField(placeholder string, state *StringState, onSubmit func()) View
SecureField creates a password input field bound to a StringState.
func SecureFieldCallbacks ¶
func SecureFieldCallbacks(placeholder string, state *StringState, onChange func(), onSubmit func()) View
SecureFieldCallbacks creates a password input field bound to a StringState with change and submit callbacks.
func SecureFieldCallbacksSelection ¶
func SecureFieldCallbacksSelection(placeholder string, state *StringState, selection *TextSelectionState, onChange func(), onSubmit func()) View
SecureFieldCallbacksSelection creates a password input field bound to a StringState plus explicit UTF-16 selection state with change and submit callbacks.
func SecureFieldSelection ¶
func SecureFieldSelection(placeholder string, state *StringState, selection *TextSelectionState, onSubmit func()) View
SecureFieldSelection creates a password input field bound to a StringState plus explicit UTF-16 selection state.
func SelectableList ¶
SelectableList displays tagged rows and binds the selected tag to an IntState. Use Tag on rows; 0 means no selection.
func ShareLinkItemRaw ¶
ShareLinkItemRaw creates a share button from a normalized payload kind and value.
func SliderTickContentForEach ¶
SliderTickContentForEach creates slider tick content from integer values.
func Table ¶
func Table(rows int, columns ...TableColumnSpec) View
Table arranges rows and columns using equal-width cells. This is a curated bridge helper, not SwiftUI's native Table container.
func TextEditor ¶
func TextEditor(state *StringState) View
TextEditor creates a multiline text editor bound to a StringState.
func TextEditorOnChange ¶
func TextEditorOnChange(state *StringState, onChange func()) View
TextEditorOnChange creates a multiline text editor bound to a StringState with a change callback.
func TextEditorOnChangeSelection ¶
func TextEditorOnChangeSelection(state *StringState, selection *TextSelectionState, onChange func()) View
TextEditorOnChangeSelection creates a multiline text editor bound to a StringState plus explicit UTF-16 selection state with a change callback.
func TextEditorSelection ¶
func TextEditorSelection(state *StringState, selection *TextSelectionState) View
TextEditorSelection creates a multiline text editor bound to a StringState plus explicit UTF-16 selection state.
func TextField ¶
func TextField(placeholder string, state *StringState, onSubmit func()) View
TextField creates a text input field bound to a StringState.
func TextFieldCallbacks ¶
func TextFieldCallbacks(placeholder string, state *StringState, onChange func(), onSubmit func()) View
TextFieldCallbacks creates a text input field bound to a StringState with change and submit callbacks.
func TextFieldCallbacksSelection ¶
func TextFieldCallbacksSelection(placeholder string, state *StringState, selection *TextSelectionState, onChange func(), onSubmit func()) View
TextFieldCallbacksSelection creates a text input field bound to a StringState plus explicit UTF-16 selection state with change and submit callbacks.
func TextFieldSelection ¶
func TextFieldSelection(placeholder string, state *StringState, selection *TextSelectionState, onSubmit func()) View
TextFieldSelection creates a text input field bound to a StringState plus explicit UTF-16 selection state.
func VStackAligned ¶
func VStackAligned(alignment HorizontalAlignment, children ...Viewable) View
VStackAligned arranges child views in a vertical stack with explicit horizontal alignment.
func VStackAlignedSpaced ¶
func VStackAlignedSpaced(alignment HorizontalAlignment, spacing float64, children ...Viewable) View
VStackAlignedSpaced arranges child views in a vertical stack with explicit alignment and spacing.
func VStackSpaced ¶
VStackSpaced arranges child views in a vertical stack with explicit spacing.
func ViewFromPointer ¶
ViewFromPointer creates a View from a raw pointer. This is used by companion packages (e.g. charts) that construct views via their own Swift bridge functions.
func (View) AccessibilityHidden ¶
AccessibilityHidden hides the view from accessibility features.
func (View) AccessibilityHint ¶
AccessibilityHint sets the accessibility hint for the view.
func (View) AccessibilityIdentifier ¶
AccessibilityIdentifier sets the accessibility identifier for the view.
func (View) AccessibilityLabel ¶
AccessibilityLabel sets the accessibility label for the view.
func (View) AccessibilityRotorJSON ¶
AccessibilityRotorJSON applies a normalized accessibility rotor payload.
func (View) AccessibilityValue ¶
AccessibilityValue sets accessibility value text for the view.
func (View) AlertPresented ¶
AlertPresented presents an alert dialog while the BoolState is true.
func (View) AllowsHitTesting ¶
AllowsHitTesting controls whether the view receives hit-test events.
func (View) Animation ¶
func (v View) Animation(kind AnimationKind) View
Animation applies an animation curve to the view.
func (View) AnimationCurve ¶
func (v View) AnimationCurve(kind AnimationKind, duration float64) View
AnimationCurve applies a named animation curve with an explicit duration in seconds. Pass 0 to use SwiftUI's default duration. Duration is ignored for spring and bouncy curves.
func (View) AspectRatio ¶
func (v View) AspectRatio(ratio float64, contentMode ContentMode) View
AspectRatio constrains the view to the given aspect ratio. ContentMode: 0=fit, 1=fill.
func (View) BackgroundRoundedRect ¶
BackgroundRoundedRect sets a rounded rectangle background.
func (View) BackgroundStyle ¶
BackgroundStyle sets a named background style (e.g. "regularMaterial", "windowBackground").
func (View) ButtonStyle ¶
func (v View) ButtonStyle(style ButtonStyleKind) View
ButtonStyle sets the button style for the view hierarchy.
func (View) ClipRoundedRect ¶
ClipRoundedRect clips the view to a rounded rectangle.
func (View) Collapsible ¶
Collapsible controls whether a section is collapsible.
func (View) ConfirmationDialog ¶
ConfirmationDialog presents a confirmation dialog with custom actions when the IntState is nonzero.
func (View) ConfirmationDialogPresented ¶
ConfirmationDialogPresented presents a confirmation dialog while the BoolState is true.
func (View) ContentShapeRectangle ¶
ContentShapeRectangle makes the view hit-test as a rectangle.
func (View) ContextMenu ¶
ContextMenu adds a right-click context menu to the view.
func (View) ControlSize ¶
func (v View) ControlSize(size ControlSize) View
ControlSize sets the control size for the view hierarchy.
func (View) CornerRadius ¶
CornerRadius clips the view to a rounded rectangle.
func (View) DefaultScrollAnchor ¶
func (v View) DefaultScrollAnchor(anchor ScrollAnchor) View
DefaultScrollAnchor sets the default anchor used when a scroll view chooses an initial target.
func (View) DraggableFileURL ¶
DraggableFileURL makes a view draggable with a file URL payload.
func (View) DraggableText ¶
DraggableText makes a view draggable with a string payload.
func (View) DraggableURL ¶
DraggableURL makes a view draggable with a URL payload.
func (View) DropDestinationFileURL ¶
DropDestinationFileURL accepts dropped file URL payloads.
func (View) DropDestinationText ¶
DropDestinationText accepts dropped text payloads.
func (View) DropDestinationURL ¶
DropDestinationURL accepts dropped URL payloads.
func (View) FixedSizeAxis ¶
FixedSizeAxis prevents expansion along specific axes.
func (View) FocusScopeID ¶
func (v View) FocusScopeID(namespace *FocusNamespace) View
FocusScopeID assigns a namespace-backed focus scope to the view hierarchy.
Bridge surface.
func (View) FocusSection ¶
FocusSection groups a set of views into a keyboard-focus section.
func (View) FontDesign ¶
FontDesign sets the font design for text in the view.
func (View) FontWeight ¶
FontWeight sets the font weight for text in the view.
func (View) ForegroundStyle ¶
ForegroundStyle sets the foreground color.
func (View) ForegroundStyleNamed ¶
ForegroundStyleNamed sets a named foreground style (primary, secondary, tertiary, quaternary).
func (View) FullScreenCover ¶
FullScreenCover presents a full-screen modal when the IntState is nonzero.
func (View) FullScreenCoverPresented ¶
FullScreenCoverPresented presents a full-screen modal while the BoolState is true.
func (View) GlassButtonStyle ¶
GlassButtonStyle applies the standard Liquid Glass button style.
func (View) GlassEffect ¶
GlassEffect applies the default Liquid Glass effect to the view.
func (View) GlassEffectID ¶
GlassEffectID assigns an identifier to Liquid Glass effects in the view.
func (View) GlassEffectIn ¶
func (v View) GlassEffectIn(glass Glass, shape GlassShape, cornerRadius float64) View
GlassEffectIn applies a Liquid Glass effect using the provided shape. cornerRadius is only used with GlassShapeRoundedRectangle.
func (View) GlassEffectShape ¶
func (v View) GlassEffectShape(shape GlassShape, cornerRadius float64) View
GlassEffectShape applies the default Liquid Glass effect using the provided shape.
func (View) GlassEffectTransition ¶
func (v View) GlassEffectTransition(transition GlassEffectTransitionKind) View
GlassEffectTransition assigns the transition used when Liquid Glass effects appear or disappear.
func (View) GlassEffectUnion ¶
GlassEffectUnion assigns a union identifier to Liquid Glass effects in the view.
func (View) GlassEffectWith ¶
GlassEffectWith applies a Liquid Glass effect using the default shape.
func (View) GlassProminentButtonStyle ¶
GlassProminentButtonStyle applies the prominent Liquid Glass button style.
func (View) ImageScale ¶
func (v View) ImageScale(scale ImageScale) View
ImageScale sets the scale for SF Symbol images.
func (View) IsDetailLink ¶
IsDetailLink marks a navigation link as a detail link.
func (View) KeyboardShortcut ¶
func (v View) KeyboardShortcut(key string, modifiers ShortcutModifier) View
KeyboardShortcut binds a keyboard shortcut to a control.
func (View) LabelsHidden ¶
LabelsHidden hides labels for controls that support label presentation.
func (View) LayoutPriority ¶
LayoutPriority sets the layout priority for this view.
func (View) ListRowBackground ¶
ListRowBackground sets a custom background for a list row.
func (View) ListStyle ¶
func (v View) ListStyle(style ListStyleKind) View
ListStyle sets the list display style.
func (View) MaxFrame ¶
MaxFrame sets maximum width/height constraints. Use FrameInfinity (-1) for .infinity, FrameUnset (0) for nil.
func (View) MenuButtonStyle ¶
func (v View) MenuButtonStyle(style MenuButtonStyleKind) View
MenuButtonStyle sets the menu button style for the view hierarchy.
func (View) NavigationSplitViewStyle ¶
func (v View) NavigationSplitViewStyle(style NavigationSplitViewStyleKind) View
NavigationSplitViewStyle sets the split view column presentation style.
func (View) NavigationTitle ¶
NavigationTitle sets the navigation title for the view.
func (View) NavigationViewStyle ¶
func (v View) NavigationViewStyle(style NavigationViewStyleKind) View
NavigationViewStyle sets the legacy navigation view style.
func (View) OnDisappear ¶
OnDisappear adds an action to perform when the view disappears.
func (View) OnHoverLocation ¶
OnHoverLocation adds a hover callback that reports phase and local pointer coordinates.
func (View) OnHoverPhase ¶
OnHoverPhase adds a hover callback that reports whether the pointer is inside the view.
func (View) OnTapGesture ¶
OnTapGesture adds a tap gesture handler to the view.
func (View) OnTapGestureCount ¶
OnTapGestureCount adds a tap gesture handler that requires the given number of taps. Use 1 for single-tap (equivalent to OnTapGesture), 2 for double-click.
func (View) PaddingEdge ¶
PaddingEdge applies padding to specific edges.
func (View) Pointer ¶
Pointer returns the underlying opaque pointer. This is used by companion packages that need to pass views to bridge functions.
func (View) PointerStyle ¶
func (v View) PointerStyle(style PointerStyleKind) View
PointerStyle sets the pointer cursor style for the view.
func (View) PopoverPresented ¶
PopoverPresented presents a popover while the BoolState is true.
func (View) PrefersDefaultFocus ¶
func (v View) PrefersDefaultFocus(preferred bool, namespace *FocusNamespace) View
PrefersDefaultFocus marks a view as the preferred initial focus target within a scope.
Bridge surface.
func (View) Refreshable ¶
Refreshable adds a native refresh action to the view.
func (*View) Release ¶
func (v *View) Release()
Release decrements the underlying Swift retain count.
func (View) RotationEffect ¶
RotationEffect rotates the view by the given angle in degrees.
func (View) SafeAreaInset ¶
SafeAreaInset attaches content to one edge of the safe area with explicit spacing.
func (View) ScaleEffect ¶
ScaleEffect scales the view uniformly.
func (View) ScaleEffectAt ¶
ScaleEffectAt scales the view around a specific anchor point.
func (View) ScrollBounceBehavior ¶
func (v View) ScrollBounceBehavior(behavior ScrollBounce, axis Axis) View
ScrollBounceBehavior sets the bounce policy for a scroll view along one axis.
func (View) ScrollContentBackgroundHidden ¶
ScrollContentBackgroundHidden hides the native scroll content background for scroll-backed controls such as TextEditor so callers can provide explicit chrome.
func (View) ScrollTargetBehavior ¶
func (v View) ScrollTargetBehavior(behavior ScrollTargetBehaviorKind) View
ScrollTargetBehavior sets how a scroll view snaps to its scroll targets.
func (View) ScrollTargetLayout ¶
ScrollTargetLayout marks a layout container as providing scroll targets.
func (View) Searchable ¶
func (v View) Searchable(query *StringState, prompt string) View
Searchable adds a search field bound to a StringState.
func (View) SheetPresented ¶
SheetPresented presents a modal sheet while the BoolState is true.
func (View) SubmitLabel ¶
func (v View) SubmitLabel(label SubmitLabelKind) View
SubmitLabel sets the submit label for text input controls.
func (View) TextFieldStyle ¶
func (v View) TextFieldStyle(style TextFieldStyleKind) View
TextFieldStyle sets the style for text fields.
func (View) ToggleStyle ¶
func (v View) ToggleStyle(style ToggleStyleKind) View
ToggleStyle sets the toggle style for the view hierarchy.
func (View) ToolbarItem ¶
func (v View) ToolbarItem(placement ToolbarItemPlacement, content Viewable) View
ToolbarItem adds a single toolbar item with the given placement.
func (View) ToolbarRole ¶
func (v View) ToolbarRole(role ToolbarRole) View
ToolbarRole sets the semantic toolbar role for the view hierarchy.
func (View) WebViewBackForwardNavigationGestures ¶
func (v View) WebViewBackForwardNavigationGestures(behavior WebViewBehavior) View
WebViewBackForwardNavigationGestures controls web view back/forward gesture behavior.
func (View) WebViewContentBackground ¶
func (v View) WebViewContentBackground(visibility WebViewContentBackgroundVisibility) View
WebViewContentBackground controls visibility of the web view content background.
func (View) WebViewElementFullscreenBehavior ¶
func (v View) WebViewElementFullscreenBehavior(behavior WebViewBehavior) View
WebViewElementFullscreenBehavior controls full-screen behavior for web page elements.
func (View) WebViewLinkPreviews ¶
func (v View) WebViewLinkPreviews(behavior WebViewBehavior) View
WebViewLinkPreviews controls whether link previews are shown.
func (View) WebViewMagnificationGestures ¶
func (v View) WebViewMagnificationGestures(behavior WebViewBehavior) View
WebViewMagnificationGestures controls magnification gesture behavior.
func (View) WebViewTextSelection ¶
WebViewTextSelection enables or disables text selection in the web view.
type Viewable ¶
type Viewable interface {
// contains filtered or unexported methods
}
Viewable is satisfied by View, ShapeView, and TextView. Functions and modifiers that take a child view accept Viewable, so any view type can be passed directly without an explicit conversion.
type WebPage
deprecated
type WebPage struct {
// contains filtered or unexported fields
}
WebPage is a retained handle to a Swift WebPage object.
Deprecated: Use webkit.NewWebPage from swift-bridge/webkit instead. This type provides only basic navigation; the webkit package exposes the full WebPage API (Title, URL, EstimatedProgress, JavaScript, PDF export, and more). To embed a web page in SwiftUI, use swiftui.ViewFromPointer(webkit.NewWebView(page)).
func NewWebPage
deprecated
func NewWebPage() *WebPage
NewWebPage creates a new WebPage handle.
Deprecated: Use webkit.NewWebPage from swift-bridge/webkit instead.
func NewWebPageURL
deprecated
type WebViewBehavior ¶
type WebViewBehavior int32
WebViewBehavior identifies web view feature behavior.
const ( WebViewBehaviorAutomatic WebViewBehavior = 0 WebViewBehaviorEnabled WebViewBehavior = 1 WebViewBehaviorDisabled WebViewBehavior = 2 )
type WebViewContentBackgroundVisibility ¶
type WebViewContentBackgroundVisibility int32
WebViewContentBackgroundVisibility identifies web view content background visibility.
const ( WebViewContentBackgroundAutomatic WebViewContentBackgroundVisibility = 0 WebViewContentBackgroundVisible WebViewContentBackgroundVisibility = 1 WebViewContentBackgroundHidden WebViewContentBackgroundVisibility = 2 )
type WindowConfig ¶
type WindowConfig struct {
Title string
Width float64
Height float64
Root View // The window's root view.
// ID identifies the window for OpenWindow. In a scene-runner app (more than
// one window, or a Settings scene) it must be non-empty and unique; an empty
// or duplicate ID makes Run return ErrWindowID. It is ignored by the
// single-window runner. Identity is never derived from the mutable Title.
ID string
}
WindowConfig configures the application window and the view it shows.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package arkit provides Go bindings for Apple's ARKit SwiftUI cross-import overlay (_ARKit_SwiftUI).
|
Package arkit provides Go bindings for Apple's ARKit SwiftUI cross-import overlay (_ARKit_SwiftUI). |
|
Package avkit provides Go bindings for Apple's AVKit SwiftUI cross-import overlay (_AVKit_SwiftUI).
|
Package avkit provides Go bindings for Apple's AVKit SwiftUI cross-import overlay (_AVKit_SwiftUI). |
|
Package charts provides Go bindings for Apple's Charts framework.
|
Package charts provides Go bindings for Apple's Charts framework. |
|
Package charts3d provides Go bindings for the 3D portion of Apple's Charts framework.
|
Package charts3d provides Go bindings for the 3D portion of Apple's Charts framework. |
|
cmd
|
|
|
swiftgovet
command
Command swiftgovet provides project-specific vet checks for SwiftUI Go code.
|
Command swiftgovet provides project-specific vet checks for SwiftUI Go code. |
|
dist
|
|
|
examples
|
|
|
accessibility
command
Command accessibility demonstrates SwiftUI accessibility modifiers from Go.
|
Command accessibility demonstrates SwiftUI accessibility modifiers from Go. |
|
animation
command
Command animation demonstrates SwiftUI animations and transitions from Go.
|
Command animation demonstrates SwiftUI animations and transitions from Go. |
|
benchview
command
|
|
|
calculator
command
Command calculator demonstrates a working calculator app built with SwiftUI from Go.
|
Command calculator demonstrates a working calculator app built with SwiftUI from Go. |
|
charts
command
Command charts showcases native Swift Charts bindings generated for Go.
|
Command charts showcases native Swift Charts bindings generated for Go. |
|
color-lab
command
Command color-lab is an interactive color mixing and exploration tool.
|
Command color-lab is an interactive color mixing and exploration tool. |
|
counter
command
Command counter demonstrates reactive state management with SwiftUI from Go.
|
Command counter demonstrates reactive state management with SwiftUI from Go. |
|
dark-light
command
Command dark-light showcases semantic foreground and background styles.
|
Command dark-light showcases semantic foreground and background styles. |
|
dashboard
command
Command dashboard demonstrates a multi-tab live dashboard with real-time Go runtime metrics, navigation, and interactive controls.
|
Command dashboard demonstrates a multi-tab live dashboard with real-time Go runtime metrics, navigation, and interactive controls. |
|
dynamic-list
command
Command dynamic-list demonstrates reactive list updates with SwiftUI from Go.
|
Command dynamic-list demonstrates reactive list updates with SwiftUI from Go. |
|
form
command
Command form demonstrates SwiftUI form controls from Go.
|
Command form demonstrates SwiftUI form controls from Go. |
|
glass
command
Command glass demonstrates material and translucency effects in SwiftUI from Go, showcasing the liquid glass aesthetic on macOS 26+.
|
Command glass demonstrates material and translucency effects in SwiftUI from Go, showcasing the liquid glass aesthetic on macOS 26+. |
|
hello-world
command
Command hello-world is a minimal but polished SwiftUI app from Go.
|
Command hello-world is a minimal but polished SwiftUI app from Go. |
|
kanban
command
Command kanban demonstrates a three-column Kanban board with card management.
|
Command kanban demonstrates a three-column Kanban board with card management. |
|
layout
command
Command layout demonstrates SwiftUI layout composition and visual styling from Go.
|
Command layout demonstrates SwiftUI layout composition and visual styling from Go. |
|
markdown-editor
command
Command markdown-editor demonstrates a split-pane text editor with live preview.
|
Command markdown-editor demonstrates a split-pane text editor with live preview. |
|
menu-bar
command
Command menu-bar demonstrates modal presentations in SwiftUI from Go.
|
Command menu-bar demonstrates modal presentations in SwiftUI from Go. |
|
multi-window
command
Command multi-window demonstrates a multi-window SwiftUI app driven from Go.
|
Command multi-window demonstrates a multi-window SwiftUI app driven from Go. |
|
music-player
command
Command music-player demonstrates a rich music player UI with playlist navigation, now-playing view, and audio visualizer using SwiftUI from Go.
|
Command music-player demonstrates a rich music player UI with playlist navigation, now-playing view, and audio visualizer using SwiftUI from Go. |
|
password-generator
command
Command password-generator demonstrates a password generator and strength analyzer built with SwiftUI from Go.
|
Command password-generator demonstrates a password generator and strength analyzer built with SwiftUI from Go. |
|
pomodoro
command
Command pomodoro demonstrates a Pomodoro technique timer built with SwiftUI from Go.
|
Command pomodoro demonstrates a Pomodoro technique timer built with SwiftUI from Go. |
|
quicklook-preview
command
Command quicklook-preview demonstrates the QuickLook SwiftUI overlay bridge.
|
Command quicklook-preview demonstrates the QuickLook SwiftUI overlay bridge. |
|
quiz
command
Command quiz demonstrates an interactive Go trivia game with animated transitions, scoring, and results using SwiftUI from Go.
|
Command quiz demonstrates an interactive Go trivia game with animated transitions, scoring, and results using SwiftUI from Go. |
|
settings
command
Command settings demonstrates a comprehensive macOS settings panel built with SwiftUI from Go.
|
Command settings demonstrates a comprehensive macOS settings panel built with SwiftUI from Go. |
|
system-monitor
command
Command system-monitor displays live Go runtime metrics using SwiftUI gauges and progress bars, updated every two seconds from a background goroutine.
|
Command system-monitor displays live Go runtime metrics using SwiftUI gauges and progress bars, updated every two seconds from a background goroutine. |
|
tabs
command
Command tabs demonstrates a polished tabbed workspace built with SwiftUI from Go.
|
Command tabs demonstrates a polished tabbed workspace built with SwiftUI from Go. |
|
timer
command
Command timer demonstrates Go goroutines driving reactive SwiftUI updates.
|
Command timer demonstrates Go goroutines driving reactive SwiftUI updates. |
|
video-player
command
Command video-player demonstrates the AVKit SwiftUI overlay bridge.
|
Command video-player demonstrates the AVKit SwiftUI overlay bridge. |
|
web-browser
command
Command web-browser demonstrates WebView embedding in SwiftUI from Go.
|
Command web-browser demonstrates WebView embedding in SwiftUI from Go. |
|
internal
|
|
|
swiftgovet/browseraction
Package browseraction reports browser controls wired to no-op callbacks.
|
Package browseraction reports browser controls wired to no-op callbacks. |
|
swiftgovet/settingsaction
Package settingsaction reports misleading Save and Revert button handlers.
|
Package settingsaction reports misleading Save and Revert button handlers. |
|
swiftgovet/swiftuiast
Package swiftuiast provides small helpers for SwiftUI-specific analyzers.
|
Package swiftuiast provides small helpers for SwiftUI-specific analyzers. |
|
Package localauth provides Go bindings for Apple's LocalAuthentication SwiftUI cross-import overlay (_LocalAuthentication_SwiftUI).
|
Package localauth provides Go bindings for Apple's LocalAuthentication SwiftUI cross-import overlay (_LocalAuthentication_SwiftUI). |
|
Package quicklook provides Go bindings for Apple's QuickLook SwiftUI cross-import overlay (_QuickLook_SwiftUI).
|
Package quicklook provides Go bindings for Apple's QuickLook SwiftUI cross-import overlay (_QuickLook_SwiftUI). |
|
Package scenekit provides Go bindings for Apple's SceneKit SwiftUI cross-import overlay (_SceneKit_SwiftUI).
|
Package scenekit provides Go bindings for Apple's SceneKit SwiftUI cross-import overlay (_SceneKit_SwiftUI). |
|
Package spritekit provides Go bindings for Apple's SpriteKit SwiftUI cross-import overlay (_SpriteKit_SwiftUI).
|
Package spritekit provides Go bindings for Apple's SpriteKit SwiftUI cross-import overlay (_SpriteKit_SwiftUI). |
|
Package translation provides Go bindings for Apple's Translation SwiftUI cross-import overlay (_Translation_SwiftUI).
|
Package translation provides Go bindings for Apple's Translation SwiftUI cross-import overlay (_Translation_SwiftUI). |
|
Package workoutkit provides Go bindings for Apple's WorkoutKit SwiftUI cross-import overlay (_WorkoutKit_SwiftUI).
|
Package workoutkit provides Go bindings for Apple's WorkoutKit SwiftUI cross-import overlay (_WorkoutKit_SwiftUI). |