A small, focused example app that shows how to integrate the Persona Inquiry SDK into an iOS app two ways — once with SwiftUI and once with UIKit — so you can copy whichever fits your codebase.
Both paths launch the same identity-verification flow and render results through one shared screen, so the only meaningful difference is how each framework starts an inquiry.
| SwiftUI | UIKit | |
|---|---|---|
| Entry point | SwiftUIInquiryView |
UIKitInquiryViewController |
| How it launches | .personaInquiry(isPresented:inquiryTemplate:…) view modifier |
Inquiry.from(templateId:delegate:).build().start(from:) |
| How results arrive | onResult: closure → PersonaResult |
InquiryDelegate callbacks |
- Xcode 16 or later (the project uses file-system–synchronized groups)
- iOS 16 or later deployment target
- A Persona account — sign up for free; it includes Sandbox access
The SDK is added via Swift Package Manager and resolves automatically when you open the project — there is nothing to install.
-
Clone and open:
git clone https://github.com/persona-id/persona-ios-sdk.git cd persona-ios-sdk open PersonaExample/PersonaExample.xcodeprojXcode will fetch the Persona SDK package on first open.
-
Add your Inquiry Template ID. Open
PersonaConfiguration.swiftand replace the placeholder:static let templateID = "itmpl_YourTemplateIdHere"
Find your template ID in the Persona Dashboard under Integration — it looks like
itmpl_XXXXXXXXXXXXXXXXX. Until you set it, the "Start verification" buttons stay disabled and the app shows a hint. -
Run on a simulator or device, and pick either the SwiftUI or the UIKit example from the home screen.
PersonaExample/PersonaExample/
├── App/PersonaExampleApp.swift # @main SwiftUI entry point
├── Configuration/PersonaConfiguration.swift # ← set your template ID here
├── Home/HomeView.swift # Picker linking to both examples
├── SwiftUIExample/
│ └── SwiftUIInquiryView.swift # SwiftUI integration (.personaInquiry)
├── UIKitExample/
│ ├── UIKitInquiryViewController.swift # UIKit integration (Inquiry builder)
│ └── UIKitInquiryView.swift # Bridges the UIKit VC into SwiftUI
└── Shared/
├── InquiryOutcome.swift # Result model used by both examples
├── InquiryResultView.swift # Shared result screen
└── ConfigurationHint.swift # "Set your template ID" notice
Attach the .personaInquiry modifier and toggle an isPresented binding:
.personaInquiry(
isPresented: $isPresentingInquiry,
inquiryTemplate: PersonaConfiguration.templateID,
builder: { $0.environment(.sandbox) },
onResult: { result in
switch result {
case let .complete(data): // data.inquiryId, data.status, data.fields
case .canceled: // dismissed before finishing
case let .errored(error): // PersonaError
@unknown default: break
}
}
)Build an inquiry and start it from a view controller that implements
InquiryDelegate:
Inquiry.from(templateId: PersonaConfiguration.templateID, delegate: self)
.environment(.sandbox)
.build()
.start(from: self)
// MARK: InquiryDelegate
func inquiryComplete(inquiryId: String, status: String, fields: [String: InquiryField]) { … }
func inquiryCanceled(inquiryId: String?, sessionToken: String?) { … }
func inquiryError(_ error: PersonaError) { … }The verification flow uses the camera, and may use the microphone, photo
library, location, and NFC depending on your template. The required
Info.plist usage-description strings are already set in
Info.plist. Adjust the copy to
match your app before shipping.
To enable NFC passport / eID reading, add the Near Field Communication Tag Reading capability to the target (Signing & Capabilities) and to your provisioning profile.
The SDK collects a user's IDFV for fraud prevention. In App Store Connect → your app → App Privacy, add a Device ID and answer:
- Usage: App Functionality (covers fraud prevention)
- Linked to the user's identity? Yes
- Used for tracking? No
- iOS Integration Guide
- iOS Changelog
- Questions? Email support@withpersona.com
Working in this repo with an AI assistant? See AGENTS.md.