rivetkit-swift/examples/hello-world-swiftui/README.md
A minimal RivetKit example that pairs a simple server with a SwiftUI app. The counter broadcasts updates in real time, so multiple app instances stay in sync.
cd rivetkit-swift/examples/hello-world-swiftui/server
pnpm install
pnpm dev
The server listens on http://127.0.0.1:8787 and exposes RivetKit at http://127.0.0.1:8787/api/rivet.
Open the Xcode project and run it:
cd rivetkit-swift/examples/hello-world-swiftui/client
open HelloWorldApp.xcodeproj
The app connects to http://127.0.0.1:8787/api/rivet by default. Override this if you are running the server elsewhere:
RIVET_ENDPOINT=http://<host-ip>:8787/api/rivet
Set the environment variable in Xcode's scheme (Run > Arguments > Environment Variables) or when using swift run.
registry.serve() for a fetch-handler setup.@Actor and listens for newCount to update the UI.examples/hello-world-cli.