Apple platforms
Checked against c1b2fa4 on 2026-11-10. The files it covers are unchanged since.
The Apple host (hosts/apple) is one SwiftUI app that builds for iOS, iPadOS,
macOS, visionOS, tvOS and watchOS. One page runs on all of them, and its
widgets, Live Activity and CarPlay screens come from the same page. On macOS
it’s native SwiftUI on AppKit, not Mac Catalyst, so its controls are Mac
controls.
Build and run
Section titled “Build and run”hosts/apple/build.sh # examples/counter on the iOS simulatorhosts/apple/build.sh --platform macos counter # a Mac app, launchedhosts/apple/build.sh --platform macos --page DIR # your own HTML pagehosts/apple/build.sh --platform ios --no-launch # a device build (needs provisioning to install)--platform is ios-sim (the default), ios, macos, tvos-sim, tvos,
visionos-sim, visionos, watchos-sim or watchos. The script builds the
core for that platform’s Rust target, compiles the host with swiftc (no
Xcode project) and leaves an ad-hoc signed app in target/ios or
target/apple/<platform>. The step-by-step setup is in
Apple apps.
An app runs one of three things: a JS bundle (the examples), an HTML page and
its files (--page), served at the app’s own origin
https://<bundle id>.app.niso/, or a native app library in any language
(--app LIB, see Native apps).
What each platform gets
Section titled “What each platform gets”Every platform builds for its simulator and its device, and counter runs on
each simulator. The details, including what’s missing per platform, are in
the host’s own notes: The Apple host.
In short:
- iOS and iPadOS: taps; hover from a trackpad or mouse; Liquid Glass buttons, switches, sliders, pickers and text fields; one window (no second iPad window).
- macOS: every mouse button, hover, wheel and trackpad scrolling, and keys
with UI Events key and code values. The core doesn’t fire
resizeorcontextmenuyet. - visionOS: look and pinch is a pointer; visionOS’s own buttons on glass. No ornaments: a page can’t declare one yet.
- tvOS: the Siri Remote arrives as keys (arrows, Enter, Escape). Spatial
navigation and the focus ring are planned (on the
tv-inputbranch, not on main yet). - watchOS: taps, the Digital Crown scrolls, the system’s text input. Fixed colors on black and one text size.
Beyond the app
Section titled “Beyond the app”- Widgets and Live Activities come from surfaces the page declares
(
hosts/apple/Widgets, published bySources/SurfacePublisher.swift). See Surfaces and Add a home screen widget. - Now Playing on the Lock Screen and Control Center comes from the page’s
media session (
Sources/Media.swift): Media session. - CarPlay shows a
carplay.listsurface as a list template and the media session as Now Playing (Sources/CarPlay.swift). It’s verified inside the app only (tests/carplay/check.sh): no CarPlay screen has shown these templates yet, because the Xcode 27 simulator’s CarPlay window was unavailable.
Appearance
Section titled “Appearance”The host publishes the platform’s semantic colors, text styles and the user’s settings (dark mode, Bold Text, Increase Contrast, Dynamic Type, the accent color on a Mac) to the page as CSS variables and media queries, and updates them live (Platform style, System settings).