iOS SDK
ResolveKit iOS SDK embeds agent chat and native tool execution inside iOS/macOS apps.
Requirements
- Swift tools:
5.9+ - Xcode:
15+ - Platforms:
iOS 16+,macOS 12+ - Backend: running ResolveKit agent runtime with valid API key
Installation (SPM)
In Xcode: File → Add Package Dependencies with:
text
https://github.com/resolve-kit/resolvekit-ios-sdkOr in Package.swift:
swift
dependencies: [
.package(url: "https://github.com/resolve-kit/resolvekit-ios-sdk", from: "1.4.2")
],
targets: [
.target(
name: "YourApp",
dependencies: [
.product(name: "ResolveKitUI", package: "resolvekit-ios-sdk")
]
)
]Module Layout
ResolveKitCore: JSON/value types, function protocol, registry, schemasResolveKitAuthoring:@ResolveKitmacro and authoring protocolResolveKitNetworking: REST + SSE clientsResolveKitUI: runtime + SwiftUI chat view + UIKit/AppKit controllers
Minimum Integration
1. Define a function
swift
import ResolveKitAuthoring
@ResolveKit(name: "get_local_time", description: "Returns current local time", requiresApproval: false)
struct GetLocalTime: ResolveKitFunction {
func perform() async throws -> String {
let formatter = ISO8601DateFormatter()
formatter.timeZone = .current
return formatter.string(from: Date())
}
}2. Create runtime
swift
import ResolveKitUI
let runtime = ResolveKitRuntime(configuration: ResolveKitConfiguration(
baseURL: URL(string: "http://localhost:8000")!,
apiKeyProvider: { "iaa_your_api_key" },
functions: [GetLocalTime.self]
))3. Show chat UI (SwiftUI)
swift
import SwiftUI
import ResolveKitUI
struct ContentView: View {
@StateObject private var runtime = ResolveKitRuntime(configuration: ResolveKitConfiguration(
baseURL: URL(string: "http://localhost:8000")!,
apiKeyProvider: { "iaa_your_api_key" },
functions: [GetLocalTime.self]
))
var body: some View {
ResolveKitChatView(runtime: runtime)
}
}Configuration Reference
ResolveKitConfiguration fields:
baseURL: URL = https://agent.example.comapiKeyProvider: () -> String?deviceIDProvider: () -> String?llmContextProvider: () -> JSONObjectavailableFunctionNamesProvider: (() -> [String])?localeProvider: () -> String?preferredLocalesProvider: (() -> [String])?functions: [AnyResolveKitFunction.Type]functionPacks: [ResolveKitFunctionPack.Type]