Skip to content

vkrychun/stem-examples-swift

Repository files navigation

StemJSON Examples

Native iOS UI/UX, generated by AI. A set of runnable iOS demos that show StemJSON in practice — the new JSON-based language AI writes, rendered as native SwiftUI by StemRuntimeSDK.

Demo of StemJSON-generated iOS UI/UX

The idea

Every module in this repo was produced through AI-assisted authoring — human-designed prompts, human selection among candidate outputs, and human editorial curation of the final JSON. StemJSON is a declarative JSON DSL designed to be written by an LLM and rendered as native SwiftUI by StemRuntimeSDK. No web views, no React Native, no JavaScript bridge.

Point an AI at the LLM spec (or the full spec for human context). Ask for the UI/UX you want. Drop the output into this workspace. Run it.

Demos at a glance

Project What it is
StemQuickStart ~20 lines of Swift. Counter + text binding. Copy this to start.
StemSwiftUI Full showcase — every module type rendered modally.
StemUIKit Same modules, UIKit host.
StemHome Native SwiftUI + StemJSON mixed in the same app with bidirectional state.

⭐ Start with StemHome

The demo that answers: can AI-generated UI coexist with hand-written SwiftUI in the same app? Yes — and this shows how.

Native SwiftUI tabs alongside an LLM-generated StemJSON module, sharing state bidirectionally. Tap a native toggle → the JSON module receives it via onCustom and updates declaratively. Change JSON state → the native view reads it back through runtime.subscribe and re-renders. runtime.trigger() from Swift, runtime.subscribe() back — no bridge, no serialization per call, no polling.

The point: you don't have to choose. Let the AI generate the feature surface; keep the critical paths in the Swift code you wrote. Both live in the same screen, backed by the same state.

For a per-module breakdown — what each JSON demonstrates and any external setup — see StemJSON/MODULES.md.

Run it

git clone https://github.com/vkrychun/stem-examples-swift.git
cd stem-examples-swift
open StemExamples.xcworkspace

In Xcode: pick a scheme, set your signing team (empty by default), run on a simulator or device. iOS 18+.

Note: on physical devices, the freeware tier of StemRuntimeSDK displays a small "Powered by StemJSON" notice on rendered surfaces. This is removable under the paid SDK licence; see the StemRuntimeSDK EULA.

Firebase (optional, for Messenger)

  1. Create a Firebase project at console.firebase.google.com, enable Firestore.
  2. Drop GoogleService-Info.plist into StemSwiftUI/StemSwiftUI/ (already .gitignored) — or paste project ID + API key into the Messenger settings sheet at runtime.

Other demos have no external dependencies.

Learn more

License

The example code in this repository — Swift sources and JSON modules — is released under the MIT License. Copy, adapt, ship.

The two projects this repo links against are governed by their own licenses:

If you redistribute or adapt the JSON modules in a product that implements StemJSON, the spec's attribution requirement still applies (see the StemJSON LICENSE).


StemJSON specification created by Vasyl Krychun — https://stemjson.com

"StemJSON", "StemRuntimeSDK", "StemRuntime", and the StemJSON logo are trademarks of Vasyl Krychun. See the StemJSON trademark policy for permitted uses.

About

Native iOS apps generated by AI from StemJSON, rendered by StemRuntimeSDK.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages