Swift setup.
Drop imaged.xcframework into your macOS or iOS target, import imaged, ship.
| Xcode | 15.0 or later |
| macOS | Sonoma 14.0+, Apple Silicon |
| iOS | 15.0+ on device, simulator slice included |
| Apple Developer team | Required for the hardened runtime to load the framework |
| License token | JWT issued from /dashboard |
-
01
Download the framework
Pull the right zip from the downloads page. macOS ships inside imaged-macos-arm64-0.10.0.tar.gz; iOS ships as imaged.xcframework-ios.zip. Both expose the same Swift module.
bashunzip imaged.xcframework-ios.zip # or extract from macOS tarball: tar -xzf imaged-macos-arm64-0.10.0.tar.gz -
02
Embed in Xcode
Drag imaged.xcframework into the project navigator. In the target's General tab, under Frameworks, Libraries, and Embedded Content, set it to Embed & Sign. Without that flag, you get "Library not loaded" at launch.
-
03
Hello world
Construct AISDK, paste the license token from /dashboard, verify it, read the version. checkLicense returns 200 on success; the same status codes appear in every binding.
swiftimport SwiftUI import imaged struct ContentView: View { @State private var ai = AISDK() @State private var status = "Initializing..." var body: some View { VStack(alignment: .leading, spacing: 8) { Text("imaged \(ai.version)").font(.title) Text(status) } .padding() .onAppear { configure() } } private func configure() { let cfg = ai.options cfg.setOption(forKey: "license.token", stringValue: "your-license-token") cfg.setOption(forKey: "license.audience", stringValue: "cameras.acme.com") let result = cfg.checkLicense() status = (result == .success && ai.isLicensed) ? "Licensed" : "License invalid (status \(result.rawValue))" } } -
04
Build and run
Press Run in Xcode. The console prints "imaged 0.10.0" and the view shows "Licensed". A status of 204 means the token key was missing; 205 means signature verification failed.
-
05
Run a family
Bundle the model file in your target, set yolo.model to its bundle path, and call ai.detect("yolo", in: image). The full pattern lives in CameraDetector.swift in the example repo.
swiftlet img = AIImage() img.load(from: "bus.jpg") cfg.setOption(forKey: "yolo.model", stringValue: Bundle.main.path(forResource: "yolo26x", ofType: "onnx")!) let response = ai.detect("yolo", in: img) for obj in response.objects ?? [] { print(obj.label ?? "?", obj.score) } -
06
Where to go next
The macOS tutorial in the examples repo walks through the same steps with screenshots and troubleshooting. The iOS app adds AVFoundation and a live overlay.