Languages
Swift
The Swift SDK is distributed by git tag. Swift Package Manager resolves straight from a repository, so there is no registry account to connect.
Install
Add it in Xcode under File → Add Packages, or in Package.swift:
dependencies: [
.package(url: "https://github.com/your-org/api-client-swift", from: "1.0.0")
]Options
| Option | Values | Default |
|---|---|---|
| Client style | functions, namespaced, class, class-namespaced | functions |
| Argument style | object, positional | object |
| Namespace | tags, path | tags |
| Doc comments | full, minimal | full |
| File header | omit, include | omit |
| Usage example | full, concise | full |
Distribution
- Connect the GitHub App
Octri needs push access to tag releases.
- Set the Swift repository
Set Repository for Swift. It's the URL your users paste into Xcode, so it's user-facing.
- Release
Octri pushes the generated code and a semver tag. SPM resolves versions from tags.
There's no registry indirection: your users' Package.swift names your repo directly. Moving or renaming it breaks every consumer's resolution, and unlike Go it also breaks Xcode projects that pinned it. Pick the repo name once.
A release SPM can resolve is a semver tag. A pushed commit without a tag is invisible to from: "1.0.0".
What callers write
import Acme
let client = AcmeClient(token: ProcessInfo.processInfo.environment["ACME_TOKEN"]!)
for try await user in client.users.list(limit: 100) {
print(user.id)
}