Ignore generated Xcode project and remove OndeExample target

keypair34 committed Apr 28, 2026 at 19:21 UTC 2a3fa305f19018b5488f2b2a313d61f96c6414ac
4 files changed +80 -5
.gitignore
+3
@@ -5,4 +5,7 @@
5 OndeFramework.xcframework/
6 OndeFramework.xcframework.zip
7
8 +# Generated by xcodegen from project.yml
9 +Examples/OndeExample/OndeExample.xcodeproj/
10 +
11 .zed
Examples/OndeExample/README.md new
+35
@@ -0,0 +1,35 @@
1 +# Onde example app
2 +
3 +A one-screen SwiftUI chat app. Loads an LLM on your iPhone and streams replies, all on-device.
4 +
5 +## Setup
6 +
7 +Install [XcodeGen](https://github.com/yonaskolb/XcodeGen) if you don't have it:
8 +
9 +```
10 +brew install xcodegen
11 +```
12 +
13 +Generate the Xcode project and open it:
14 +
15 +```
16 +cd Examples/OndeExample
17 +xcodegen generate
18 +open OndeExample.xcodeproj
19 +```
20 +
21 +Set your development team under Signing & Capabilities, pick your iPhone, hit Run.
22 +
23 +## What it does
24 +
25 +On first launch, it downloads and loads the default model for your device (Qwen 2.5 Coder 1.5B on iPhone, 3B on Mac). After that you can chat with it. Responses stream in token by token, and there's a stop button if you want to cut it short.
26 +
27 +## Files
28 +
29 +| File | What's in it |
30 +|------|-------------|
31 +| `App.swift` | Entry point. Calls `setupInferenceEnvironment()` at launch. |
32 +| `ContentView.swift` | The chat UI: message bubbles, text input, loading spinner. |
33 +| `ChatViewModel.swift` | Bridges UniFFI's sync `StreamChunkListener` callback into an `AsyncStream` so SwiftUI can consume tokens on the main actor. |
34 +| `InferenceEnvironment.swift` | Sets `HF_HOME` inside the app sandbox so HuggingFace downloads land somewhere iOS allows. |
35 +| `project.yml` | XcodeGen spec. The `.xcodeproj` is generated from this, not checked in. |
Examples/OndeExample/project.yml new
+42
@@ -0,0 +1,42 @@
1 +name: OndeExample
2 +options:
3 + bundleIdPrefix: com.ondeinference
4 + deploymentTarget:
5 + iOS: "16.0"
6 + xcodeVersion: "16.0"
7 + generateEmptyDirectories: false
8 + createIntermediateGroups: false
9 +
10 +packages:
11 + Onde:
12 + path: ../..
13 +
14 +targets:
15 + OndeExample:
16 + type: application
17 + platform: iOS
18 + sources:
19 + - path: .
20 + excludes:
21 + - project.yml
22 + - "*.xcodeproj"
23 + dependencies:
24 + - package: Onde
25 + product: Onde
26 + settings:
27 + base:
28 + PRODUCT_BUNDLE_IDENTIFIER: com.ondeinference.OndeExample
29 + MARKETING_VERSION: "1.0.0"
30 + CURRENT_PROJECT_VERSION: 1
31 + GENERATE_INFOPLIST_FILE: YES
32 + INFOPLIST_KEY_UIApplicationSceneManifest_Generation: YES
33 + INFOPLIST_KEY_UILaunchScreen_Generation: YES
34 + SWIFT_VERSION: "6.0"
35 + ENABLE_USER_SCRIPT_SANDBOXING: YES
36 + configs:
37 + Debug:
38 + SWIFT_OPTIMIZATION_LEVEL: -Onone
39 + CODE_SIGN_IDENTITY: "Apple Development"
40 + Release:
41 + SWIFT_OPTIMIZATION_LEVEL: -O
42 + CODE_SIGN_IDENTITY: "Apple Distribution"
Package.swift
-5
@@ -42,10 +42,5 @@ let package = Package(
42 dependencies: [.target(name: "OndeFramework")],
43 path: "Sources/Onde"
44 ),
45 - .executableTarget(
46 - name: "OndeExample",
47 - dependencies: [.target(name: "Onde")],
48 - path: "Examples/OndeExample"
49 - ),
45 ]
46 )