FlexForm iOS SDKSwiftUI Integration, Server-Driven Forms
Add production-ready forms to your iOS app without a WebView. FlexForm's iOS SDK delivers native form rendering wrapped in a UIViewController — integrating with SwiftUI in three lines of code.
iOS SDK Features
Native rendering, SPM distribution, and server-driven updates
Native UIViewController
Forms render inside a standard UIViewController — slot it into any UIKit or SwiftUI app with UIViewControllerRepresentable.
SPM & CocoaPods
Distributed as XCFramework supporting device and simulator slices. Install via Swift Package Manager or CocoaPods with one line.
Offline Drafts
Bundled SQLite preserves form progress locally. Users can complete forms without connectivity and submit when back online.
Conditional Logic
Server-defined page branching, field visibility rules, and skip logic — all evaluated client-side from the form JSON.
Theme Override
Control colors, typography, and button styles to match your iOS app's design language. Dark mode supported.
Server-Driven Updates
Form fields live on the server. Add questions, fix logic, or change validation without pushing a new App Store version.
SwiftUI integration
UIViewControllerRepresentable wrapper — three lines to embed any form.
// Swift Package Manager — add in Xcode or Package.swift
// .package(url: "https://github.com/flexform/flexform-ios-sdk", from: "1.0.0-beta")
import SwiftUI
import FlexFormSDK
// Wrap in UIViewControllerRepresentable for SwiftUI
struct FlexFormView: UIViewControllerRepresentable {
let formId: String
func makeUIViewController(context: Context) -> UIViewController {
FlexFormUIViewController(
formId: formId,
config: FlexFormConfig(autoSaveDraft: true),
onEvent: { event in
switch event {
case .submitted(let formId, let responses):
print("Form \(formId) submitted: \(responses)")
case .error(_, let message, _):
print("Error: \(message)")
default:
break
}
}
)
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}
// Use it like any SwiftUI view
struct ContentView: View {
var body: some View {
FlexFormView(formId: "your-form-id")
.ignoresSafeArea()
}
}Requirements
iOS SDK FAQs
Common questions about the FlexForm iOS SDK
Does the FlexForm iOS SDK use a WebView?
No. The SDK uses Kotlin/Native (Compose Multiplatform compiled for iOS) to render all form elements natively as UIKit views. There is no WKWebView or UIWebView involved.
How do I integrate the iOS SDK into a SwiftUI app?
Wrap FlexFormUIViewController in a UIViewControllerRepresentable struct and use it like any SwiftUI View. The SDK handles all layout, navigation, validation, and submission internally.
What iOS version is required?
The FlexForm iOS SDK requires iOS 14 or later.
How is the iOS SDK distributed?
The SDK is distributed as an XCFramework supporting arm64 (device), x86_64 (simulator), and arm64 (simulator) slices. It is available via Swift Package Manager and CocoaPods.
Can I customize the form's appearance on iOS?
Yes. Pass a FlexFormTheme override via FlexFormConfig to control primary color, background, text colors, typography, and button styles. The theme system supports both light and dark modes.
How do I handle what happens after a form is submitted?
The SDK calls your onEvent callback with a Submitted event, which includes the formId and a dictionary of all field responses. From there you can navigate to a thank-you screen, dismiss the view, or trigger any app logic.
Add Forms to Your iOS App
Native iOS form rendering with server-driven updates. No WebView — forms feel like a native part of your app.