iOS SDK
A native, hot-reloading SwiftUI preview of your AI-generated Swift. No simulator, no backend, no API key.
Installation
Add the package in Package.swift:
dependencies: [
.package(url: "https://github.com/portomatic/portomatic-ios.git", from: "0.1.0"),
],
targets: [
.target(name: "App", dependencies: [
.product(name: "Portomatic", package: "portomatic-ios"),
]),
],Configure
Point the client at the server, then drop PortomaticPreview into any view. It renders the current build and hot-reloads.
import SwiftUI
import Portomatic
@main
struct MyApp: App {
init() {
Portomatic.shared.setup(host: "https://api.portomatic.com")
}
var body: some Scene {
WindowGroup { PortomaticPreview() }
}
}Submit source
Send source from your agent; the matching preview swaps to it.
let result = try await Portomatic.shared.submit(
files: ["ContentView.swift": generatedSource],
root: "ContentView"
)
// A compile failure comes back as result.ok == false
// with result.diagnostics — feed it back to the agent.