Expand description
SwiftUI App lifecycle — pure Rust, no Swift compiler.
Constructs a SwiftUI App conformance at run time by building:
- A zero-size struct metadata (the “app type”)
- An
Appprotocol witness table withbody.getter - A scene for that body to return — see
crate::scene
Then calls App.main(), which enters the SwiftUI event loop.
§Example
use swiftui_native::{app, views};
app::run(|| views::text("Hello from pure Rust!"));A whole app rather than one window:
use swiftui_native::{app, scene, views};
app::run_scene(|| scene::group(vec![
scene::window_group(|| views::text("main")),
scene::settings(|| views::text("preferences")),
]));