TL;DR: Fern’s Swift SDK generator is live. Instantly provide iOS developers with an idiomatic Swift client for your API.
Why we’re launching our Swift SDK generator
We built a Swift SDK generator because our customers asked for it.
A Swift SDK is useful for any iOS developer who wants to integrate faster and with fewer errors when calling your API. No more writing networking and data-parsing code from scratch.
A generated Swift SDK that feels handwritten
When designing our SDKs, we studied several sources, including popular client Swift libraries—including Stripe’s iOS SDK and Apple’s own Swift SDK generator. We found these to provide solid baselines, but also reveal opportunities for Fern to take a different approach.
As a simple example, Apple’s Swift SDK generator often outputs large files, with some containing more than 40,000 lines of code. For developers, this is difficult to navigate. We’ve broken this into multiple files, making the SDK easier to read and maintain, while also giving it the structure of something thoughtfully written by a developer, not just machine-generated.
Additionally, Apple leans on heavy namespacing (e.g., Components.Schemas.User), whereas Fern keeps namespaces minimal (e.g., just User). While deep namespaces simplify implementation by avoiding name collisions, we take a more developer-friendly approach: actively managing collisions by tracking symbols and resolving conflicts through scoped names or renames. The result is simple, clean type names without cumbersome hierarchies.
Additional highlights of our Swift SDK include:
- Zero external dependencies
- Modern async/await support across the entire SDK
- Strong typing with no force unwrapping or unsafe operations
- Forward-compatible structs, so new fields in types won’t break existing code
- Automatic retries with exponential backoff
The result is a SDK that doesn’t just work out of the box, but feels like it was handwritten by a fellow Swift developer.
Automatic SDK publishing to GitHub for Swift Package Manager (SPM)
Every time your API changes, Fern generates and publishes a new SDK release to GitHub. Developers can add the SDK to their Package.swift with a single line, and Swift Package Manager (SPM) pulls the release from GitHub. The result is a seamless onboarding experience for your Swift developers.
What customers are saying about our Swift SDK
We first rolled out our Swift SDK generator with select customers, starting with Chrt's Swift SDK, an early design partner.
Using our API from Swift is basically frictionless with Fern’s SDK generator. We dogfood the SDK in our own iOS app. It’s super easy to generate and they nailed the details — namespacing, typing and nullables, async/await, refreshable auth, and more. The dev experience and support from the Fern team have both been fantastic. — Aaron Carver
Fern's Swift SDK generator is designed for fintech, healthtech, and enterprise SaaS companies that want to provide a first-class Swift SDK to their developers.
Reach out to learn more about our Swift SDK generator
If you’re interested in offering a Swift SDK to your developers, please reach out to learn more or check out the quickstart.
FAQs
- What is a Swift SDK and why do I need one? A Swift SDK is a prebuilt client library that lets iOS, macOS, watchOS, and tvOS developers integrate with your API faster. Instead of writing networking and JSON parsing logic from scratch, developers can import the SDK and immediately call your API with type-safe, idiomatic Swift code.
- Does the Fern Swift SDK support async/await? Yes. The SDK uses modern async/await patterns throughout, so your API calls integrate seamlessly with Swift’s concurrency model.
- What makes Fern’s Swift SDK different from other code generators? Fern’s Swift SDKs are designed to feel handwritten. We generate small, maintainable files with clean type names, zero dependencies, and idiomatic Swift conventions.
- What programming languages does Fern support? The Fern SDK generator outputs client libraries in TypeScript, Python, Java (Kotlin-compatible), Go, Ruby, C# (.NET), PHP, and Swift (iOS).
- What API specifications does Fern support? The Fern SDK generator supports OpenAPI (versions 2.x and 3.x), AsyncAPI (3.x), and gRPC/Protobuf.
- How do I get started with Fern’s Swift SDK generator? Get started with the Swift Quickstart. First, install the Fern CLI and point it at your API specification (OpenAPI, AsyncAPI, or gRPC). With a single command, Fern generates a production-ready Swift SDK that you can add to your project through Swift Package Manager. From there, you can import the SDK in your code and start making type-safe API calls with async/await. Whenever your API changes, just rerun the generator to produce an updated SDK instantly.