swiftui

package module
v0.0.0-...-f6767b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2026 License: MIT Imports: 16 Imported by: 0

README

swiftui

Go Reference

Go bindings for Apple's SwiftUI framework on macOS. The root package exposes core SwiftUI views, modifiers, and app lifecycle APIs, and subpackages such as avkit, quicklook, and spritekit expose framework overlays that return view pointers compatible with swiftui.ViewFromPointer.

Auto-generated from Apple developer documentation via an internal tool called applegen.

Requirements

  • macOS 26 or later with the Swift toolchain available in PATH
  • Xcode or Command Line Tools if the vendored bridge needs to be built

The vendored Swift bridge is loaded at runtime. If no prebuilt dylib is available, the package runs swift build in internal/swift/ automatically.

Quick start

package main

import (
	"log"
	"runtime"

	"github.com/tmc/swiftui"
)

func init() { runtime.LockOSThread() }

func main() {
	if err := swiftui.Run(swiftui.App{Windows: []swiftui.WindowConfig{{
		Title:  "Hello World",
		Width:  400,
		Height: 300,
		Root:   swiftui.Text("Hello from Go!").Padding(20).AsView(),
	}}}); err != nil {
		log.Fatal(err)
	}
}

Try the bundled example with:

go run ./examples/hello-world

Scenes & multiple windows

A single swiftui.App describes every surface an app presents, so the same Run call covers single-window, multi-window, menu-bar, and Settings apps. Give each window a stable ID (required once there is more than one), and open or focus one at runtime with swiftui.OpenWindow:

app := swiftui.App{
	Windows: []swiftui.WindowConfig{
		{ID: "main", Title: "Main", Width: 520, Height: 360, Root: mainView},
		{ID: "inspector", Title: "Inspector", Width: 320, Height: 320, Root: inspectorView},
	},
	Settings: &swiftui.SettingsConfig{Title: "Settings", Root: settingsView},
}
swiftui.Run(app)

// Later, from a button callback, open or focus the inspector by id:
if err := swiftui.OpenWindow("inspector"); err != nil {
	log.Printf("open inspector: %v", err)
}

A menu-bar (status-bar) app sets App.MenuBar instead of (or alongside) Windows; swiftui.RunMenuBar and swiftui.RunWithMenuBar are conveniences for the common cases.

go run ./examples/multi-window

Disclaimer

This is not an official Apple product. Apple, macOS, and all related frameworks are trademarks of Apple Inc. This project is an independent, community-driven effort and is not affiliated with, endorsed by, or sponsored by Apple Inc.

License

MIT

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
}

Index

Examples

Constants

View Source
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

View Source
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")
)
View Source
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

func OpenWindow(id string) error

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 RenderPNG

func RenderPNG(path string, root View, width, height, scale float64) error

RenderPNG renders a SwiftUI view hierarchy to a PNG file without opening a window.

func Run

func Run(app App) error

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 Axis

type Axis int32

Axis identifies layout axes.

const (
	AxisHorizontal Axis = 0
	AxisVertical   Axis = 1
)

type BoolState

type BoolState struct {
	// contains filtered or unexported fields
}

BoolState is an observable boolean state value.

func NewBoolState

func NewBoolState(initial bool) *BoolState

NewBoolState creates a new observable boolean state.

func (*BoolState) Get

func (s *BoolState) Get() bool

Get returns the current boolean value.

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) Set

func (s *BoolState) Set(v bool)

Set updates the boolean value.

func (*BoolState) SetAnimated

func (s *BoolState) SetAnimated(v bool)

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 NewCanvasOps

func NewCanvasOps() *CanvasOps

NewCanvasOps creates an empty CanvasOps buffer.

func (*CanvasOps) Bytes

func (c *CanvasOps) Bytes() []byte

Bytes returns a reference to the opcode buffer. The slice is valid until the next mutation on c.

func (*CanvasOps) Clip

func (c *CanvasOps) Clip(p *Path) *CanvasOps

Clip restricts subsequent drawing to the interior of the given Path.

func (*CanvasOps) Fill

func (c *CanvasOps) Fill(p *Path, col Color) *CanvasOps

Fill fills the given Path with the given color.

func (*CanvasOps) Opacity

func (c *CanvasOps) Opacity(a float64) *CanvasOps

Opacity sets the global opacity multiplier for subsequent drawing.

func (*CanvasOps) Reset

func (c *CanvasOps) Reset() *CanvasOps

Reset clears the opcode buffer without releasing backing storage. Useful for per-frame rebuilds.

func (*CanvasOps) Rotate

func (c *CanvasOps) Rotate(radians float64) *CanvasOps

Rotate rotates the coordinate system by the given angle in radians.

func (*CanvasOps) Scale

func (c *CanvasOps) Scale(sx, sy float64) *CanvasOps

Scale multiplies the coordinate system by (sx, sy).

func (*CanvasOps) Stroke

func (c *CanvasOps) Stroke(p *Path, col Color, lineWidth float64, dash []float64) *CanvasOps

Stroke outlines the given Path with the given color and line width. If dash is non-empty, the outline uses the provided dash pattern (in points, alternating on/off); pass nil for a solid stroke.

func (*CanvasOps) Translate

func (c *CanvasOps) Translate(dx, dy float64) *CanvasOps

Translate shifts the coordinate system by (dx, dy).

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.

func RGB

func RGB(r, g, b float64) Color

RGB creates an opaque Color from red, green, and blue components (0.0-1.0).

func RGBA

func RGBA(r, g, b, a float64) Color

RGBA creates a Color from red, green, blue, and alpha components (0.0-1.0).

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) A

func (s *ColorState) A() float64

A returns the alpha component (0.0-1.0).

func (*ColorState) B

func (s *ColorState) B() float64

B returns the blue component (0.0-1.0).

func (*ColorState) G

func (s *ColorState) G() float64

G returns the green component (0.0-1.0).

func (*ColorState) R

func (s *ColorState) R() float64

R returns the red component (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

func NewDateState(epochSeconds float64) *DateState

NewDateState creates a new reactive date state from Unix epoch seconds.

func (*DateState) Get

func (s *DateState) Get() float64

Get returns the current date as 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.

func (*DateState) Set

func (s *DateState) Set(epochSeconds float64)

Set updates the date from Unix epoch seconds.

type Design

type Design int32

Design identifies font design presets.

const (
	DesignDefault    Design = 0
	DesignRounded    Design = 1
	DesignMonospaced Design = 2
	DesignSerif      Design = 3
)

type Edge

type Edge int32

Edge identifies edges for padding and layout.

const (
	EdgeTop        Edge = 1
	EdgeLeading    Edge = 2
	EdgeBottom     Edge = 4
	EdgeTrailing   Edge = 8
	EdgeAll        Edge = 15
	EdgeHorizontal Edge = 10
	EdgeVertical   Edge = 5
)

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) Get

func (s *FloatState) Get() float64

Get returns the current float64 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 FontNamed

func FontNamed(name string) Font

FontNamed returns a named preset font (e.g. "largeTitle", "body").

func FontSystem

func FontSystem(size float64) Font

FontSystem returns a system font at the given point size.

func FontSystemDesign

func FontSystemDesign(size float64, weight Weight, design Design) Font

FontSystemDesign returns a system font with explicit weight and design. Use Weight* and Design* constants for the weight and design parameters.

func (*Font) Release

func (f *Font) Release()

Release decrements the underlying Swift retain count.

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 GlassClear

func GlassClear() Glass

GlassClear returns the clear Liquid Glass variant.

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

func (g Glass) Interactive(enabled bool) Glass

Interactive returns a copy of g with explicit interactivity behavior.

func (Glass) Tint

func (g Glass) Tint(color Color) Glass

Tint returns a copy of g with the given tint color.

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

func AdaptiveGridItem(minimum, maximum float64) GridItem

AdaptiveGridItem creates an adaptive grid track.

func FixedGridItem

func FixedGridItem(size float64) GridItem

FixedGridItem creates a fixed-width or fixed-height grid track.

func FlexibleGridItem

func FlexibleGridItem(minimum, maximum float64) GridItem

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

func NewIntState(initial int) *IntState

NewIntState creates a new reactive integer state with the given initial value.

func (*IntState) Get

func (s *IntState) Get() int

Get returns the current 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) Set

func (s *IntState) Set(v int)

Set updates the value, triggering SwiftUI view updates.

func (*IntState) SetAnimated

func (s *IntState) SetAnimated(v int)

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 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 struct {
	MonospacedDigits bool
	Animate          bool
}

MenuBarLabelStyle controls visual behavior when updating the status label.

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 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.

func (*Namespace) Release

func (ns *Namespace) Release()

Release decrements the underlying Swift retain count.

type NavigationSplitViewStyleKind int32

NavigationSplitViewStyleKind identifies navigation split view styles.

const (
	NavigationSplitViewStyleAutomatic       NavigationSplitViewStyleKind = 0
	NavigationSplitViewStyleBalanced        NavigationSplitViewStyleKind = 1
	NavigationSplitViewStyleProminentDetail NavigationSplitViewStyleKind = 2
)
type NavigationSplitViewVisibilityKind int32

NavigationSplitViewVisibilityKind identifies column visibility.

const (
	NavigationSplitViewVisibilityAutomatic    NavigationSplitViewVisibilityKind = 0
	NavigationSplitViewVisibilityAll          NavigationSplitViewVisibilityKind = 1
	NavigationSplitViewVisibilityDoubleColumn NavigationSplitViewVisibilityKind = 2
	NavigationSplitViewVisibilityDetailOnly   NavigationSplitViewVisibilityKind = 3
)
type NavigationViewStyleKind int32

NavigationViewStyleKind identifies legacy navigation view styles.

const (
	NavigationViewStyleAutomatic    NavigationViewStyleKind = 0
	NavigationViewStyleColumn       NavigationViewStyleKind = 1
	NavigationViewStyleDoubleColumn NavigationViewStyleKind = 2
	NavigationViewStyleStack        NavigationViewStyleKind = 3
)

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 NewPath

func NewPath() *Path

NewPath creates a fresh Path with an empty opcode buffer.

func (*Path) Arc

func (p *Path) Arc(cx, cy, r, startRadians, endRadians float64, clockwise bool) *Path

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

func (p *Path) Bytes() []byte

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

func (p *Path) Close() *Path

Close closes the current subpath by appending a straight segment back to its starting point.

func (*Path) Cubic

func (p *Path) Cubic(c1x, c1y, c2x, c2y, x, y float64) *Path

Cubic appends a cubic bezier segment with two control points. This is the primary building block for Sankey ribbons and curved network edges.

func (*Path) Ellipse

func (p *Path) Ellipse(x, y, w, h float64) *Path

Ellipse appends an ellipse subpath inscribed in the given rectangle.

func (*Path) Line

func (p *Path) Line(x, y float64) *Path

Line appends a straight segment from the current point to (x, y).

func (*Path) Move

func (p *Path) Move(x, y float64) *Path

Move starts a new subpath at (x, y).

func (*Path) Quad

func (p *Path) Quad(cx, cy, x, y float64) *Path

Quad appends a quadratic bezier segment with a single control point.

func (*Path) Rect

func (p *Path) Rect(x, y, w, h float64) *Path

Rect appends an axis-aligned rectangle subpath.

func (*Path) Reset

func (p *Path) Reset() *Path

Reset clears the opcode buffer without releasing backing storage.

func (*Path) View

func (p *Path) View() View

View returns a SwiftUI View that renders this Path as a shape. The returned View carries an AnyShape sidecar, so the standard shape modifiers (.Fill, .Stroke, .StrokeStyle) work on it.

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
	PickerStyleNavigationLink PickerStyleKind = 5
	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 Capsule

func Capsule() ShapeView

Capsule creates a capsule shape.

func Circle

func Circle() ShapeView

Circle creates a circle shape filling available space.

func Rectangle

func Rectangle() ShapeView

Rectangle creates a rectangle shape filling available space.

func RoundedRectangle

func RoundedRectangle(cornerRadius float64) ShapeView

RoundedRectangle creates a rounded rectangle shape.

func (ShapeView) AccessibilityHidden

func (v ShapeView) AccessibilityHidden(hidden bool) ShapeView

AccessibilityHidden hides the view from accessibility features.

func (ShapeView) AccessibilityHint

func (v ShapeView) AccessibilityHint(hint string) ShapeView

AccessibilityHint sets the accessibility hint for the view.

func (ShapeView) AccessibilityIdentifier

func (v ShapeView) AccessibilityIdentifier(identifier string) ShapeView

AccessibilityIdentifier sets the accessibility identifier for the view.

func (ShapeView) AccessibilityLabel

func (v ShapeView) AccessibilityLabel(label string) ShapeView

AccessibilityLabel sets the accessibility label for the view.

func (ShapeView) AccessibilityRotorJSON

func (v ShapeView) AccessibilityRotorJSON(modelJSON string) ShapeView

AccessibilityRotorJSON applies a normalized accessibility rotor payload.

func (ShapeView) AccessibilityValue

func (v ShapeView) AccessibilityValue(value string) ShapeView

AccessibilityValue sets accessibility value text for the view.

func (ShapeView) Alert

func (v ShapeView) Alert(title string, message string, state *IntState) ShapeView

Alert presents an alert dialog when the IntState is nonzero.

func (ShapeView) AlertPresented

func (v ShapeView) AlertPresented(title string, message string, state *BoolState) ShapeView

AlertPresented presents an alert dialog while the BoolState is true.

func (ShapeView) AllowsHitTesting

func (v ShapeView) AllowsHitTesting(enabled bool) ShapeView

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) AsView

func (v ShapeView) AsView() View

AsView returns the underlying View, discarding the shape type.

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

func (v ShapeView) Background(c Color) ShapeView

Background sets a background color.

func (ShapeView) BackgroundRoundedRect

func (v ShapeView) BackgroundRoundedRect(c Color, cornerRadius float64) ShapeView

BackgroundRoundedRect sets a rounded rectangle background.

func (ShapeView) BackgroundStyle

func (v ShapeView) BackgroundStyle(name string) ShapeView

BackgroundStyle sets a named background style (e.g. "regularMaterial", "windowBackground").

func (ShapeView) Blur

func (v ShapeView) Blur(radius float64) ShapeView

Blur applies a Gaussian blur effect.

func (ShapeView) Border

func (v ShapeView) Border(c Color, width float64) ShapeView

Border adds a border to the view.

func (ShapeView) ButtonStyle

func (v ShapeView) ButtonStyle(style ButtonStyleKind) ShapeView

ButtonStyle sets the button style for the view hierarchy.

func (ShapeView) ClipRoundedRect

func (v ShapeView) ClipRoundedRect(cornerRadius float64) ShapeView

ClipRoundedRect clips the view to a rounded rectangle.

func (ShapeView) Clipped

func (v ShapeView) Clipped() ShapeView

Clipped clips the view to its bounding frame.

func (ShapeView) Collapsible

func (v ShapeView) Collapsible(collapsible bool) ShapeView

Collapsible controls whether a section is collapsible.

func (ShapeView) ConfirmationDialog

func (v ShapeView) ConfirmationDialog(title string, state *IntState, actions Viewable) ShapeView

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

func (v ShapeView) ContentShapeRectangle() ShapeView

ContentShapeRectangle makes the view hit-test as a rectangle.

func (ShapeView) ContextMenu

func (v ShapeView) ContextMenu(content Viewable) ShapeView

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

func (v ShapeView) CornerRadius(radius float64) ShapeView

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) Disabled

func (v ShapeView) Disabled(disabled bool) ShapeView

Disabled disables user interaction for the view.

func (ShapeView) DraggableFileURL

func (v ShapeView) DraggableFileURL(path string) ShapeView

DraggableFileURL makes a view draggable with a file URL payload.

func (ShapeView) DraggableText

func (v ShapeView) DraggableText(text string) ShapeView

DraggableText makes a view draggable with a string payload.

func (ShapeView) DraggableURL

func (v ShapeView) DraggableURL(url string) ShapeView

DraggableURL makes a view draggable with a URL payload.

func (ShapeView) DropDestinationFileURL

func (v ShapeView) DropDestinationFileURL(action func(string) bool) ShapeView

DropDestinationFileURL accepts dropped file URL payloads.

func (ShapeView) DropDestinationText

func (v ShapeView) DropDestinationText(action func(string) bool) ShapeView

DropDestinationText accepts dropped text payloads.

func (ShapeView) DropDestinationURL

func (v ShapeView) DropDestinationURL(action func(string) bool) ShapeView

DropDestinationURL accepts dropped URL payloads.

func (ShapeView) Fill

func (v ShapeView) Fill(c Color) ShapeView

Fill sets the fill color for shape views.

func (ShapeView) FixedSize

func (v ShapeView) FixedSize() ShapeView

FixedSize prevents the view from expanding beyond its ideal size.

func (ShapeView) FixedSizeAxis

func (v ShapeView) FixedSizeAxis(horizontal bool, vertical bool) ShapeView

FixedSizeAxis prevents expansion along specific axes.

func (ShapeView) Focusable

func (v ShapeView) Focusable(focusable bool) ShapeView

Focusable controls whether the view can receive keyboard focus.

func (ShapeView) Focused

func (v ShapeView) Focused(state *BoolState) ShapeView

Focused binds keyboard focus to a BoolState for explicit focus control.

func (ShapeView) Font

func (v ShapeView) Font(f Font) ShapeView

Font sets the font for the view.

func (ShapeView) FontDesign

func (v ShapeView) FontDesign(design Design) ShapeView

FontDesign sets the font design for text in the view.

func (ShapeView) FontWeight

func (v ShapeView) FontWeight(weight Weight) ShapeView

FontWeight sets the font weight for text in the view.

func (ShapeView) ForegroundStyle

func (v ShapeView) ForegroundStyle(c Color) ShapeView

ForegroundStyle sets the foreground color.

func (ShapeView) ForegroundStyleNamed

func (v ShapeView) ForegroundStyleNamed(name string) ShapeView

ForegroundStyleNamed sets a named foreground style (primary, secondary, tertiary, quaternary).

func (ShapeView) Frame

func (v ShapeView) Frame(width float64, height float64) ShapeView

Frame sets an explicit width and height for the view.

func (ShapeView) FullScreenCover

func (v ShapeView) FullScreenCover(state *IntState, content Viewable) ShapeView

FullScreenCover presents a full-screen modal when the IntState is nonzero.

func (ShapeView) FullScreenCoverPresented

func (v ShapeView) FullScreenCoverPresented(state *BoolState, content Viewable) ShapeView

FullScreenCoverPresented presents a full-screen modal while the BoolState is true.

func (ShapeView) Help

func (v ShapeView) Help(text string) ShapeView

Help adds a tooltip to the view.

func (ShapeView) ID

func (v ShapeView) ID(id int) ShapeView

ID assigns a stable integer identity for ScrollViewReader scroll targets.

func (ShapeView) ImageScale

func (v ShapeView) ImageScale(scale ImageScale) ShapeView

ImageScale sets the scale for SF Symbol images.

func (v ShapeView) IsDetailLink(isDetailLink bool) ShapeView

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

func (v ShapeView) LabelsHidden() ShapeView

LabelsHidden hides labels for controls that support label presentation.

func (ShapeView) LayoutPriority

func (v ShapeView) LayoutPriority(priority float64) ShapeView

LayoutPriority sets the layout priority for this view.

func (ShapeView) ListRowBackground

func (v ShapeView) ListRowBackground(background Viewable) ShapeView

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) Mask

func (v ShapeView) Mask(mask Viewable) ShapeView

Mask clips the view using the given view as a mask.

func (ShapeView) MaxFrame

func (v ShapeView) MaxFrame(maxWidth float64, maxHeight float64) ShapeView

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

func (v ShapeView) NavigationTitle(title string) ShapeView

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) Offset

func (v ShapeView) Offset(x float64, y float64) ShapeView

Offset moves the view by the given x and y distances.

func (ShapeView) OnAppear

func (v ShapeView) OnAppear(action func()) ShapeView

OnAppear adds an action to perform when the view appears.

func (ShapeView) OnDisappear

func (v ShapeView) OnDisappear(action func()) ShapeView

OnDisappear adds an action to perform when the view disappears.

func (ShapeView) OnHover

func (v ShapeView) OnHover(action func()) ShapeView

OnHover adds a hover callback. The callback fires when hover state changes.

func (ShapeView) OnHoverLocation

func (v ShapeView) OnHoverLocation(action func(bool, float64, float64)) ShapeView

OnHoverLocation adds a hover callback that reports phase and local pointer coordinates.

func (ShapeView) OnHoverPhase

func (v ShapeView) OnHoverPhase(action func(bool)) ShapeView

OnHoverPhase adds a hover callback that reports whether the pointer is inside the view.

func (ShapeView) OnTapGesture

func (v ShapeView) OnTapGesture(action func()) ShapeView

OnTapGesture adds a tap gesture handler to the view.

func (ShapeView) OnTapGestureCount

func (v ShapeView) OnTapGestureCount(count int, action func()) ShapeView

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) Opacity

func (v ShapeView) Opacity(opacity float64) ShapeView

Opacity sets the opacity of the view (0.0 to 1.0).

func (ShapeView) Overlay

func (v ShapeView) Overlay(overlay Viewable) ShapeView

Overlay places another view on top of this view.

func (ShapeView) Padding

func (v ShapeView) Padding(amount float64) ShapeView

Padding applies uniform padding around the view.

func (ShapeView) PaddingEdge

func (v ShapeView) PaddingEdge(edges Edge, amount float64) ShapeView

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) Popover

func (v ShapeView) Popover(state *IntState, content Viewable) ShapeView

Popover presents a popover when the IntState is nonzero.

func (ShapeView) PopoverPresented

func (v ShapeView) PopoverPresented(state *BoolState, content Viewable) ShapeView

PopoverPresented presents a popover while the BoolState is true.

func (ShapeView) Refreshable

func (v ShapeView) Refreshable(action func()) ShapeView

Refreshable adds a native refresh action to the view.

func (ShapeView) RotationEffect

func (v ShapeView) RotationEffect(degrees float64) ShapeView

RotationEffect rotates the view by the given angle in degrees.

func (ShapeView) SafeAreaInset

func (v ShapeView) SafeAreaInset(edge Edge, spacing float64, content Viewable) ShapeView

SafeAreaInset attaches content to one edge of the safe area with explicit spacing.

func (ShapeView) ScaleEffect

func (v ShapeView) ScaleEffect(scale float64) ShapeView

ScaleEffect scales the view uniformly.

func (ShapeView) ScaleEffectAt

func (v ShapeView) ScaleEffectAt(scale float64, anchor UnitPoint) ShapeView

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

func (v ShapeView) ScrollContentBackgroundHidden() ShapeView

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

func (v ShapeView) ScrollTargetLayout() ShapeView

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) Shadow

func (v ShapeView) Shadow(c Color, radius float64, x float64, y float64) ShapeView

Shadow adds a shadow effect to the view.

func (ShapeView) Sheet

func (v ShapeView) Sheet(state *IntState, content Viewable) ShapeView

Sheet presents a modal sheet when the IntState is nonzero.

func (ShapeView) SheetPresented

func (v ShapeView) SheetPresented(state *BoolState, content Viewable) ShapeView

SheetPresented presents a modal sheet while the BoolState is true.

func (ShapeView) Stroke

func (v ShapeView) Stroke(c Color, lineWidth float64) ShapeView

Stroke sets the stroke color and width for shape views.

func (ShapeView) StrokeStyle

func (v ShapeView) StrokeStyle(col Color, lineWidth float64, dash []float64) ShapeView

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) TabItem

func (v ShapeView) TabItem(label string, systemImage string) ShapeView

TabItem sets the tab label and icon for use inside a TabView.

func (ShapeView) Tag

func (v ShapeView) Tag(tag int32) ShapeView

Tag assigns an integer tag for selection tracking.

func (ShapeView) TextFieldStyle

func (v ShapeView) TextFieldStyle(style TextFieldStyleKind) ShapeView

TextFieldStyle sets the style for text fields.

func (ShapeView) Tint

func (v ShapeView) Tint(c Color) ShapeView

Tint applies a tint color to the view.

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

func (v ShapeView) WebViewTextSelection(enabled bool) ShapeView

WebViewTextSelection enables or disables text selection in the web view.

func (ShapeView) ZIndex

func (v ShapeView) ZIndex(index float64) ShapeView

ZIndex sets the front-to-back ordering of the view within a ZStack.

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) Get

func (s *StringState) Get() string

Get returns the current string 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

type TableColumnSpec struct {
	Header View
	Cell   func(row int) View
}

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 Label

func Label(text string, systemImage string) TextView

Label creates a label with text and an SF Symbol icon.

func Text

func Text(s string) TextView

Text creates a text view displaying the given string.

func TextFrom

func TextFrom(state *IntState) TextView

TextFrom creates a text view that reactively displays an IntState value.

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

func (v TextView) AccessibilityHidden(hidden bool) TextView

AccessibilityHidden hides the view from accessibility features.

func (TextView) AccessibilityHint

func (v TextView) AccessibilityHint(hint string) TextView

AccessibilityHint sets the accessibility hint for the view.

func (TextView) AccessibilityIdentifier

func (v TextView) AccessibilityIdentifier(identifier string) TextView

AccessibilityIdentifier sets the accessibility identifier for the view.

func (TextView) AccessibilityLabel

func (v TextView) AccessibilityLabel(label string) TextView

AccessibilityLabel sets the accessibility label for the view.

func (TextView) AccessibilityRotorJSON

func (v TextView) AccessibilityRotorJSON(modelJSON string) TextView

AccessibilityRotorJSON applies a normalized accessibility rotor payload.

func (TextView) AccessibilityValue

func (v TextView) AccessibilityValue(value string) TextView

AccessibilityValue sets accessibility value text for the view.

func (TextView) Alert

func (v TextView) Alert(title string, message string, state *IntState) TextView

Alert presents an alert dialog when the IntState is nonzero.

func (TextView) AlertPresented

func (v TextView) AlertPresented(title string, message string, state *BoolState) TextView

AlertPresented presents an alert dialog while the BoolState is true.

func (TextView) AllowsHitTesting

func (v TextView) AllowsHitTesting(enabled bool) TextView

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) AsView

func (v TextView) AsView() View

AsView returns the underlying View, discarding the text type.

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

func (v TextView) Background(c Color) TextView

Background sets a background color.

func (TextView) BackgroundRoundedRect

func (v TextView) BackgroundRoundedRect(c Color, cornerRadius float64) TextView

BackgroundRoundedRect sets a rounded rectangle background.

func (TextView) BackgroundStyle

func (v TextView) BackgroundStyle(name string) TextView

BackgroundStyle sets a named background style (e.g. "regularMaterial", "windowBackground").

func (TextView) Blur

func (v TextView) Blur(radius float64) TextView

Blur applies a Gaussian blur effect.

func (TextView) Bold

func (v TextView) Bold() TextView

Bold applies bold font weight to text in the view.

func (TextView) Border

func (v TextView) Border(c Color, width float64) TextView

Border adds a border to the view.

func (TextView) ButtonStyle

func (v TextView) ButtonStyle(style ButtonStyleKind) TextView

ButtonStyle sets the button style for the view hierarchy.

func (TextView) ClipRoundedRect

func (v TextView) ClipRoundedRect(cornerRadius float64) TextView

ClipRoundedRect clips the view to a rounded rectangle.

func (TextView) Clipped

func (v TextView) Clipped() TextView

Clipped clips the view to its bounding frame.

func (TextView) Collapsible

func (v TextView) Collapsible(collapsible bool) TextView

Collapsible controls whether a section is collapsible.

func (TextView) ConfirmationDialog

func (v TextView) ConfirmationDialog(title string, state *IntState, actions Viewable) TextView

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

func (v TextView) ContentShapeRectangle() TextView

ContentShapeRectangle makes the view hit-test as a rectangle.

func (TextView) ContextMenu

func (v TextView) ContextMenu(content Viewable) TextView

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

func (v TextView) CornerRadius(radius float64) TextView

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) Disabled

func (v TextView) Disabled(disabled bool) TextView

Disabled disables user interaction for the view.

func (TextView) DraggableFileURL

func (v TextView) DraggableFileURL(path string) TextView

DraggableFileURL makes a view draggable with a file URL payload.

func (TextView) DraggableText

func (v TextView) DraggableText(text string) TextView

DraggableText makes a view draggable with a string payload.

func (TextView) DraggableURL

func (v TextView) DraggableURL(url string) TextView

DraggableURL makes a view draggable with a URL payload.

func (TextView) DropDestinationFileURL

func (v TextView) DropDestinationFileURL(action func(string) bool) TextView

DropDestinationFileURL accepts dropped file URL payloads.

func (TextView) DropDestinationText

func (v TextView) DropDestinationText(action func(string) bool) TextView

DropDestinationText accepts dropped text payloads.

func (TextView) DropDestinationURL

func (v TextView) DropDestinationURL(action func(string) bool) TextView

DropDestinationURL accepts dropped URL payloads.

func (TextView) FixedSize

func (v TextView) FixedSize() TextView

FixedSize prevents the view from expanding beyond its ideal size.

func (TextView) FixedSizeAxis

func (v TextView) FixedSizeAxis(horizontal bool, vertical bool) TextView

FixedSizeAxis prevents expansion along specific axes.

func (TextView) Focusable

func (v TextView) Focusable(focusable bool) TextView

Focusable controls whether the view can receive keyboard focus.

func (TextView) Focused

func (v TextView) Focused(state *BoolState) TextView

Focused binds keyboard focus to a BoolState for explicit focus control.

func (TextView) Font

func (v TextView) Font(f Font) TextView

Font sets the font for the view.

func (TextView) FontDesign

func (v TextView) FontDesign(design Design) TextView

FontDesign sets the font design for text in the view.

func (TextView) FontWeight

func (v TextView) FontWeight(weight Weight) TextView

FontWeight sets the font weight for text in the view.

func (TextView) ForegroundStyle

func (v TextView) ForegroundStyle(c Color) TextView

ForegroundStyle sets the foreground color.

func (TextView) ForegroundStyleNamed

func (v TextView) ForegroundStyleNamed(name string) TextView

ForegroundStyleNamed sets a named foreground style (primary, secondary, tertiary, quaternary).

func (TextView) Frame

func (v TextView) Frame(width float64, height float64) TextView

Frame sets an explicit width and height for the view.

func (TextView) FullScreenCover

func (v TextView) FullScreenCover(state *IntState, content Viewable) TextView

FullScreenCover presents a full-screen modal when the IntState is nonzero.

func (TextView) FullScreenCoverPresented

func (v TextView) FullScreenCoverPresented(state *BoolState, content Viewable) TextView

FullScreenCoverPresented presents a full-screen modal while the BoolState is true.

func (TextView) Help

func (v TextView) Help(text string) TextView

Help adds a tooltip to the view.

func (TextView) ID

func (v TextView) ID(id int) TextView

ID assigns a stable integer identity for ScrollViewReader scroll targets.

func (TextView) ImageScale

func (v TextView) ImageScale(scale ImageScale) TextView

ImageScale sets the scale for SF Symbol images.

func (v TextView) IsDetailLink(isDetailLink bool) TextView

IsDetailLink marks a navigation link as a detail link.

func (TextView) Italic

func (v TextView) Italic() TextView

Italic applies italic style to text in the view.

func (TextView) KeyboardShortcut

func (v TextView) KeyboardShortcut(key string, modifiers ShortcutModifier) TextView

KeyboardShortcut binds a keyboard shortcut to a control.

func (TextView) LabelsHidden

func (v TextView) LabelsHidden() TextView

LabelsHidden hides labels for controls that support label presentation.

func (TextView) LayoutPriority

func (v TextView) LayoutPriority(priority float64) TextView

LayoutPriority sets the layout priority for this view.

func (TextView) LineLimit

func (v TextView) LineLimit(n int) TextView

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

func (v TextView) ListRowBackground(background Viewable) TextView

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) Mask

func (v TextView) Mask(mask Viewable) TextView

Mask clips the view using the given view as a mask.

func (TextView) MaxFrame

func (v TextView) MaxFrame(maxWidth float64, maxHeight float64) TextView

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

func (v TextView) MonospacedDigit() TextView

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

func (v TextView) NavigationTitle(title string) TextView

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) Offset

func (v TextView) Offset(x float64, y float64) TextView

Offset moves the view by the given x and y distances.

func (TextView) OnAppear

func (v TextView) OnAppear(action func()) TextView

OnAppear adds an action to perform when the view appears.

func (TextView) OnDisappear

func (v TextView) OnDisappear(action func()) TextView

OnDisappear adds an action to perform when the view disappears.

func (TextView) OnHover

func (v TextView) OnHover(action func()) TextView

OnHover adds a hover callback. The callback fires when hover state changes.

func (TextView) OnHoverLocation

func (v TextView) OnHoverLocation(action func(bool, float64, float64)) TextView

OnHoverLocation adds a hover callback that reports phase and local pointer coordinates.

func (TextView) OnHoverPhase

func (v TextView) OnHoverPhase(action func(bool)) TextView

OnHoverPhase adds a hover callback that reports whether the pointer is inside the view.

func (TextView) OnTapGesture

func (v TextView) OnTapGesture(action func()) TextView

OnTapGesture adds a tap gesture handler to the view.

func (TextView) OnTapGestureCount

func (v TextView) OnTapGestureCount(count int, action func()) TextView

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) Opacity

func (v TextView) Opacity(opacity float64) TextView

Opacity sets the opacity of the view (0.0 to 1.0).

func (TextView) Overlay

func (v TextView) Overlay(overlay Viewable) TextView

Overlay places another view on top of this view.

func (TextView) Padding

func (v TextView) Padding(amount float64) TextView

Padding applies uniform padding around the view.

func (TextView) PaddingEdge

func (v TextView) PaddingEdge(edges Edge, amount float64) TextView

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) Popover

func (v TextView) Popover(state *IntState, content Viewable) TextView

Popover presents a popover when the IntState is nonzero.

func (TextView) PopoverPresented

func (v TextView) PopoverPresented(state *BoolState, content Viewable) TextView

PopoverPresented presents a popover while the BoolState is true.

func (TextView) Refreshable

func (v TextView) Refreshable(action func()) TextView

Refreshable adds a native refresh action to the view.

func (TextView) RotationEffect

func (v TextView) RotationEffect(degrees float64) TextView

RotationEffect rotates the view by the given angle in degrees.

func (TextView) SafeAreaInset

func (v TextView) SafeAreaInset(edge Edge, spacing float64, content Viewable) TextView

SafeAreaInset attaches content to one edge of the safe area with explicit spacing.

func (TextView) ScaleEffect

func (v TextView) ScaleEffect(scale float64) TextView

ScaleEffect scales the view uniformly.

func (TextView) ScaleEffectAt

func (v TextView) ScaleEffectAt(scale float64, anchor UnitPoint) TextView

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

func (v TextView) ScrollContentBackgroundHidden() TextView

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

func (v TextView) ScrollTargetLayout() TextView

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) Shadow

func (v TextView) Shadow(c Color, radius float64, x float64, y float64) TextView

Shadow adds a shadow effect to the view.

func (TextView) Sheet

func (v TextView) Sheet(state *IntState, content Viewable) TextView

Sheet presents a modal sheet when the IntState is nonzero.

func (TextView) SheetPresented

func (v TextView) SheetPresented(state *BoolState, content Viewable) TextView

SheetPresented presents a modal sheet while the BoolState is true.

func (TextView) Strikethrough

func (v TextView) Strikethrough() TextView

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) TabItem

func (v TextView) TabItem(label string, systemImage string) TextView

TabItem sets the tab label and icon for use inside a TabView.

func (TextView) Tag

func (v TextView) Tag(tag int32) TextView

Tag assigns an integer tag for selection tracking.

func (TextView) TextFieldStyle

func (v TextView) TextFieldStyle(style TextFieldStyleKind) TextView

TextFieldStyle sets the style for text fields.

func (TextView) Tint

func (v TextView) Tint(c Color) TextView

Tint applies a tint color to the view.

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) Underline

func (v TextView) Underline() TextView

Underline adds an underline to text in the view.

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

func (v TextView) WebViewTextSelection(enabled bool) TextView

WebViewTextSelection enables or disables text selection in the web view.

func (TextView) ZIndex

func (v TextView) ZIndex(index float64) TextView

ZIndex sets the front-to-back ordering of the view within a ZStack.

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
	ToolbarItemPlacementNavigation         ToolbarItemPlacement = 2
	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
	ToolbarRoleNavigationStack ToolbarRole = 2
)

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

func AsyncImage(url string) View

AsyncImage loads and displays an image from a URL.

func Button

func Button(label string, action func()) View

Button creates a clickable button with a text label.

func ButtonView

func ButtonView(label Viewable, action func()) View

ButtonView creates a clickable button using a custom label view.

func ButtonWithImage

func ButtonWithImage(systemName string, action func()) View

ButtonWithImage creates a clickable button with an SF Symbol icon.

func ButtonWithLabel

func ButtonWithLabel(text string, systemImage string, action func()) View

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 ColorView

func ColorView(c Color) View

ColorView creates a color view filling available space.

func DatePicker

func DatePicker(label string, state *DateState, onChange func()) View

DatePicker creates a date picker bound to a DateState.

func DisclosureGroupView

func DisclosureGroupView(label Viewable, expanded *BoolState, content Viewable) View

DisclosureGroupView creates a disclosure group with a custom label view and BoolState-backed expansion state.

func Divider

func Divider() View

Divider creates a visual divider line.

func DynamicBoolView

func DynamicBoolView(state *BoolState, builder func(value bool) View) View

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

func DynamicView(state *IntState, builder func(value int) View) View

DynamicView creates a view whose content is rebuilt by a Go callback whenever the observed IntState changes.

func EmptyView

func EmptyView() View

EmptyView creates an invisible empty view.

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 Form

func Form(children ...Viewable) View

Form groups controls for data entry.

func Gauge

func Gauge(value float64, label string) View

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

func GeometryReader(builder func(width, height float64) View) View

GeometryReader creates a view whose content is built with the available width and height.

func GlassEffectContainer

func GlassEffectContainer(content View) View

GlassEffectContainer groups Liquid Glass effects so SwiftUI can blend and morph them together.

func GlassEffectContainerSpaced

func GlassEffectContainerSpaced(spacing float64, content View) View

GlassEffectContainerSpaced groups Liquid Glass effects with explicit container spacing.

func GroupBox

func GroupBox(label string, content Viewable) View

GroupBox creates a titled group box containing the given content.

func HStack

func HStack(children ...Viewable) View

HStack arranges child views in a horizontal stack.

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

func HStackSpaced(spacing float64, children ...Viewable) View

HStackSpaced arranges child views in a horizontal stack with explicit spacing.

func Image

func Image(systemName string) View

Image creates an image view from an SF Symbol name.

func ImageFromFile

func ImageFromFile(path string) View

ImageFromFile creates an image view from a file path.

func ImageNamed

func ImageNamed(name string) View

ImageNamed creates an image view from a named image resource in the asset catalog.

func LazyHGrid

func LazyHGrid(rows []GridItem, spacing float64, children ...Viewable) View

LazyHGrid arranges child views into a horizontal grid using the provided row count.

func LazyHStack

func LazyHStack(children ...Viewable) View

LazyHStack arranges child views in a horizontal stack with lazy rendering.

func LazyVGrid

func LazyVGrid(columns []GridItem, spacing float64, children ...Viewable) View

LazyVGrid arranges child views into a vertical grid using the provided column count.

func LazyVStack

func LazyVStack(children ...Viewable) View

LazyVStack arranges child views in a vertical stack with lazy rendering.

func LinearGradient

func LinearGradient(start, end Color, startPoint, endPoint UnitPoint) View

LinearGradient creates a two-stop linear gradient view.

func LinearGradientHorizontal

func LinearGradientHorizontal(leading, trailing Color) View

LinearGradientHorizontal creates a leading-to-trailing two-stop linear gradient view.

func LinearGradientVertical

func LinearGradientVertical(top, bottom Color) View

LinearGradientVertical creates a top-to-bottom two-stop linear gradient view.

func Link(title string, url string) View

Link creates a navigation link that opens a URL.

func List

func List(children ...Viewable) View

List displays rows of data with platform-appropriate styling.

func Menu(label string, content Viewable) View

Menu creates a dropdown menu with the given label and content.

func MenuView(label Viewable, content Viewable) View

MenuView creates a dropdown menu with a custom label view and content.

func MeshGradient4

func MeshGradient4(topLeading, topTrailing, bottomLeading, bottomTrailing Color) View

MeshGradient4 creates a four-corner mesh gradient view.

func NavigationLink(label string, destination Viewable) View

NavigationLink creates a link to a destination view within a NavigationStack.

func NavigationSplitView(sidebar Viewable, detail Viewable) View

NavigationSplitView presents sidebar and detail content in a split navigation interface.

func NavigationSplitViewTriple(sidebar Viewable, content Viewable, detail Viewable) View

NavigationSplitViewTriple presents sidebar, content, and detail columns in a split navigation interface.

func NavigationSplitViewTripleVisibility(visibility *IntState, sidebar Viewable, content Viewable, detail Viewable) View

NavigationSplitViewTripleVisibility presents three columns with IntState-backed column visibility.

func NavigationSplitViewVisibility(visibility *IntState, sidebar Viewable, detail Viewable) View

NavigationSplitViewVisibility presents sidebar and detail content with IntState-backed column visibility.

func NavigationStack(content Viewable) View

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

func PickerMenu(label string, state *IntState, options Viewable, onChange func()) View

PickerMenu creates a dropdown menu picker bound to an IntState.

func PickerSegmented

func PickerSegmented(label string, state *IntState, options Viewable, onChange func()) View

PickerSegmented creates a segmented picker bound to an IntState.

func ProgressLinear

func ProgressLinear(value float64, total float64) View

ProgressLinear creates a determinate linear progress indicator.

func ProgressSpinning

func ProgressSpinning() View

ProgressSpinning creates an indeterminate spinning progress indicator.

func RadialGradient

func RadialGradient(inner, outer Color, center UnitPoint, startRadius, endRadius float64) View

RadialGradient creates a two-stop radial gradient view.

func ScrollView

func ScrollView(content Viewable) View

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 Section

func Section(header string, content Viewable) View

Section groups content with a header label.

func SectionExpanded

func SectionExpanded(header string, expanded *BoolState, content Viewable) View

SectionExpanded groups content with a header label and a BoolState-backed disclosure state.

func SectionExpandedView

func SectionExpandedView(header Viewable, expanded *BoolState, content Viewable) View

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

func SelectableList(selection *IntState, children ...Viewable) View

SelectableList displays tagged rows and binds the selected tag to an IntState. Use Tag on rows; 0 means no selection.

func ShareLink(title string, url string) View

ShareLink creates a share button for a concrete URL.

func ShareLinkItemRaw

func ShareLinkItemRaw(title string, kind string, value string, filePath string) View

ShareLinkItemRaw creates a share button from a normalized payload kind and value.

func Slider

func Slider(label string, state *IntState, min float64, max float64, onChange func()) View

Slider creates a slider bound to an IntState within a range.

func SliderTickContentForEach

func SliderTickContentForEach(values []int32, id int32, content func(value int) View) View

SliderTickContentForEach creates slider tick content from integer values.

func Spacer

func Spacer() View

Spacer creates a flexible space that expands along the major axis.

func Stepper

func Stepper(label string, state *IntState, min int, max int, onChange func()) View

Stepper creates an increment/decrement control bound to an IntState.

func TabView

func TabView(children ...Viewable) View

TabView presents multiple child views as tabs.

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 Toggle

func Toggle(label string, state *IntState, onChange func()) View

Toggle creates a toggle switch bound to an IntState (0=off, nonzero=on).

func VStack

func VStack(children ...Viewable) View

VStack arranges child views in a vertical stack.

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

func VStackSpaced(spacing float64, children ...Viewable) View

VStackSpaced arranges child views in a vertical stack with explicit spacing.

func ViewFromPointer

func ViewFromPointer(ptr uintptr) View

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 ZStack

func ZStack(children ...Viewable) View

ZStack overlays child views back to front.

func (View) AccessibilityHidden

func (v View) AccessibilityHidden(hidden bool) View

AccessibilityHidden hides the view from accessibility features.

func (View) AccessibilityHint

func (v View) AccessibilityHint(hint string) View

AccessibilityHint sets the accessibility hint for the view.

func (View) AccessibilityIdentifier

func (v View) AccessibilityIdentifier(identifier string) View

AccessibilityIdentifier sets the accessibility identifier for the view.

func (View) AccessibilityLabel

func (v View) AccessibilityLabel(label string) View

AccessibilityLabel sets the accessibility label for the view.

func (View) AccessibilityRotorJSON

func (v View) AccessibilityRotorJSON(modelJSON string) View

AccessibilityRotorJSON applies a normalized accessibility rotor payload.

func (View) AccessibilityValue

func (v View) AccessibilityValue(value string) View

AccessibilityValue sets accessibility value text for the view.

func (View) Alert

func (v View) Alert(title string, message string, state *IntState) View

Alert presents an alert dialog when the IntState is nonzero.

func (View) AlertPresented

func (v View) AlertPresented(title string, message string, state *BoolState) View

AlertPresented presents an alert dialog while the BoolState is true.

func (View) AllowsHitTesting

func (v View) AllowsHitTesting(enabled bool) View

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) Background

func (v View) Background(c Color) View

Background sets a background color.

func (View) BackgroundRoundedRect

func (v View) BackgroundRoundedRect(c Color, cornerRadius float64) View

BackgroundRoundedRect sets a rounded rectangle background.

func (View) BackgroundStyle

func (v View) BackgroundStyle(name string) View

BackgroundStyle sets a named background style (e.g. "regularMaterial", "windowBackground").

func (View) Blur

func (v View) Blur(radius float64) View

Blur applies a Gaussian blur effect.

func (View) Border

func (v View) Border(c Color, width float64) View

Border adds a border to the view.

func (View) ButtonStyle

func (v View) ButtonStyle(style ButtonStyleKind) View

ButtonStyle sets the button style for the view hierarchy.

func (View) ClipRoundedRect

func (v View) ClipRoundedRect(cornerRadius float64) View

ClipRoundedRect clips the view to a rounded rectangle.

func (View) Clipped

func (v View) Clipped() View

Clipped clips the view to its bounding frame.

func (View) Collapsible

func (v View) Collapsible(collapsible bool) View

Collapsible controls whether a section is collapsible.

func (View) ConfirmationDialog

func (v View) ConfirmationDialog(title string, state *IntState, actions Viewable) View

ConfirmationDialog presents a confirmation dialog with custom actions when the IntState is nonzero.

func (View) ConfirmationDialogPresented

func (v View) ConfirmationDialogPresented(title string, state *BoolState, actions Viewable) View

ConfirmationDialogPresented presents a confirmation dialog while the BoolState is true.

func (View) ContentShapeRectangle

func (v View) ContentShapeRectangle() View

ContentShapeRectangle makes the view hit-test as a rectangle.

func (View) ContextMenu

func (v View) ContextMenu(content Viewable) View

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

func (v View) CornerRadius(radius float64) View

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) Disabled

func (v View) Disabled(disabled bool) View

Disabled disables user interaction for the view.

func (View) DraggableFileURL

func (v View) DraggableFileURL(path string) View

DraggableFileURL makes a view draggable with a file URL payload.

func (View) DraggableText

func (v View) DraggableText(text string) View

DraggableText makes a view draggable with a string payload.

func (View) DraggableURL

func (v View) DraggableURL(url string) View

DraggableURL makes a view draggable with a URL payload.

func (View) DropDestinationFileURL

func (v View) DropDestinationFileURL(action func(string) bool) View

DropDestinationFileURL accepts dropped file URL payloads.

func (View) DropDestinationText

func (v View) DropDestinationText(action func(string) bool) View

DropDestinationText accepts dropped text payloads.

func (View) DropDestinationURL

func (v View) DropDestinationURL(action func(string) bool) View

DropDestinationURL accepts dropped URL payloads.

func (View) FixedSize

func (v View) FixedSize() View

FixedSize prevents the view from expanding beyond its ideal size.

func (View) FixedSizeAxis

func (v View) FixedSizeAxis(horizontal bool, vertical bool) View

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

func (v View) FocusSection() View

FocusSection groups a set of views into a keyboard-focus section.

func (View) Focusable

func (v View) Focusable(focusable bool) View

Focusable controls whether the view can receive keyboard focus.

func (View) Focused

func (v View) Focused(state *BoolState) View

Focused binds keyboard focus to a BoolState for explicit focus control.

func (View) Font

func (v View) Font(f Font) View

Font sets the font for the view.

func (View) FontDesign

func (v View) FontDesign(design Design) View

FontDesign sets the font design for text in the view.

func (View) FontWeight

func (v View) FontWeight(weight Weight) View

FontWeight sets the font weight for text in the view.

func (View) ForegroundStyle

func (v View) ForegroundStyle(c Color) View

ForegroundStyle sets the foreground color.

func (View) ForegroundStyleNamed

func (v View) ForegroundStyleNamed(name string) View

ForegroundStyleNamed sets a named foreground style (primary, secondary, tertiary, quaternary).

func (View) Frame

func (v View) Frame(width float64, height float64) View

Frame sets an explicit width and height for the view.

func (View) FullScreenCover

func (v View) FullScreenCover(state *IntState, content Viewable) View

FullScreenCover presents a full-screen modal when the IntState is nonzero.

func (View) FullScreenCoverPresented

func (v View) FullScreenCoverPresented(state *BoolState, content Viewable) View

FullScreenCoverPresented presents a full-screen modal while the BoolState is true.

func (View) GlassButtonStyle

func (v View) GlassButtonStyle(glass Glass) View

GlassButtonStyle applies the standard Liquid Glass button style.

func (View) GlassEffect

func (v View) GlassEffect() View

GlassEffect applies the default Liquid Glass effect to the view.

func (View) GlassEffectID

func (v View) GlassEffectID(id string, namespace *Namespace) View

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

func (v View) GlassEffectUnion(id string, namespace *Namespace) View

GlassEffectUnion assigns a union identifier to Liquid Glass effects in the view.

func (View) GlassEffectWith

func (v View) GlassEffectWith(glass Glass) View

GlassEffectWith applies a Liquid Glass effect using the default shape.

func (View) GlassProminentButtonStyle

func (v View) GlassProminentButtonStyle() View

GlassProminentButtonStyle applies the prominent Liquid Glass button style.

func (View) Help

func (v View) Help(text string) View

Help adds a tooltip to the view.

func (View) ID

func (v View) ID(id int) View

ID assigns a stable integer identity for ScrollViewReader scroll targets.

func (View) ImageScale

func (v View) ImageScale(scale ImageScale) View

ImageScale sets the scale for SF Symbol images.

func (v View) IsDetailLink(isDetailLink bool) View

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

func (v View) LabelsHidden() View

LabelsHidden hides labels for controls that support label presentation.

func (View) LayoutPriority

func (v View) LayoutPriority(priority float64) View

LayoutPriority sets the layout priority for this view.

func (View) ListRowBackground

func (v View) ListRowBackground(background Viewable) View

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) Mask

func (v View) Mask(mask Viewable) View

Mask clips the view using the given view as a mask.

func (View) MaxFrame

func (v View) MaxFrame(maxWidth float64, maxHeight float64) View

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

func (v View) NavigationTitle(title string) View

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) Offset

func (v View) Offset(x float64, y float64) View

Offset moves the view by the given x and y distances.

func (View) OnAppear

func (v View) OnAppear(action func()) View

OnAppear adds an action to perform when the view appears.

func (View) OnDisappear

func (v View) OnDisappear(action func()) View

OnDisappear adds an action to perform when the view disappears.

func (View) OnHover

func (v View) OnHover(action func()) View

OnHover adds a hover callback. The callback fires when hover state changes.

func (View) OnHoverLocation

func (v View) OnHoverLocation(action func(bool, float64, float64)) View

OnHoverLocation adds a hover callback that reports phase and local pointer coordinates.

func (View) OnHoverPhase

func (v View) OnHoverPhase(action func(bool)) View

OnHoverPhase adds a hover callback that reports whether the pointer is inside the view.

func (View) OnTapGesture

func (v View) OnTapGesture(action func()) View

OnTapGesture adds a tap gesture handler to the view.

func (View) OnTapGestureCount

func (v View) OnTapGestureCount(count int, action func()) View

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) Opacity

func (v View) Opacity(opacity float64) View

Opacity sets the opacity of the view (0.0 to 1.0).

func (View) Overlay

func (v View) Overlay(overlay Viewable) View

Overlay places another view on top of this view.

func (View) Padding

func (v View) Padding(amount float64) View

Padding applies uniform padding around the view.

func (View) PaddingEdge

func (v View) PaddingEdge(edges Edge, amount float64) View

PaddingEdge applies padding to specific edges.

func (View) Pointer

func (v View) Pointer() uintptr

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) Popover

func (v View) Popover(state *IntState, content Viewable) View

Popover presents a popover when the IntState is nonzero.

func (View) PopoverPresented

func (v View) PopoverPresented(state *BoolState, content Viewable) View

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

func (v View) Refreshable(action func()) View

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

func (v View) RotationEffect(degrees float64) View

RotationEffect rotates the view by the given angle in degrees.

func (View) SafeAreaInset

func (v View) SafeAreaInset(edge Edge, spacing float64, content Viewable) View

SafeAreaInset attaches content to one edge of the safe area with explicit spacing.

func (View) ScaleEffect

func (v View) ScaleEffect(scale float64) View

ScaleEffect scales the view uniformly.

func (View) ScaleEffectAt

func (v View) ScaleEffectAt(scale float64, anchor UnitPoint) View

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

func (v View) ScrollContentBackgroundHidden() View

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

func (v View) ScrollTargetLayout() View

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) Shadow

func (v View) Shadow(c Color, radius float64, x float64, y float64) View

Shadow adds a shadow effect to the view.

func (View) Sheet

func (v View) Sheet(state *IntState, content Viewable) View

Sheet presents a modal sheet when the IntState is nonzero.

func (View) SheetPresented

func (v View) SheetPresented(state *BoolState, content Viewable) View

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) TabItem

func (v View) TabItem(label string, systemImage string) View

TabItem sets the tab label and icon for use inside a TabView.

func (View) Tag

func (v View) Tag(tag int32) View

Tag assigns an integer tag for selection tracking.

func (View) TextFieldStyle

func (v View) TextFieldStyle(style TextFieldStyleKind) View

TextFieldStyle sets the style for text fields.

func (View) Tint

func (v View) Tint(c Color) View

Tint applies a tint color to the view.

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

func (v View) WebViewTextSelection(enabled bool) View

WebViewTextSelection enables or disables text selection in the web view.

func (View) ZIndex

func (v View) ZIndex(index float64) View

ZIndex sets the front-to-back ordering of the view within a ZStack.

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

func NewWebPageURL(url string) *WebPage

NewWebPageURL creates a WebPage and starts loading the given URL.

Deprecated: Use webkit.NewWebPageWithURL from swift-bridge/webkit instead.

func (*WebPage) LoadURL deprecated

func (p *WebPage) LoadURL(url string)

LoadURL loads a URL string on the page.

Deprecated: Use webkit.WebPage.LoadURL from swift-bridge/webkit instead.

func (*WebPage) Pointer

func (p *WebPage) Pointer() uintptr

Pointer returns the underlying Swift WebPage object pointer.

func (*WebPage) Release

func (p *WebPage) Release()

Release decrements the underlying Swift retain count for this page.

func (*WebPage) Reload deprecated

func (p *WebPage) Reload()

Reload reloads the current page.

Deprecated: Use webkit.WebPage.Reload from swift-bridge/webkit instead.

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 Weight

type Weight int32

Weight identifies font weight presets.

const (
	WeightUltraLight Weight = 0
	WeightThin       Weight = 1
	WeightLight      Weight = 2
	WeightRegular    Weight = 3
	WeightMedium     Weight = 4
	WeightSemibold   Weight = 5
	WeightBold       Weight = 6
	WeightHeavy      Weight = 7
	WeightBlack      Weight = 8
)

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.

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL