1
Add the Swift Package to Xcode
Open your project in Xcode, then choose File → Add Package Dependencies. Paste the repository URL into the search field and press Return:Select the
Candid product and add it to your app target. Xcode resolves the package and makes the CandidSDK module available to import.Candid requires iOS 17 or later and Xcode 16 with Swift 6. Make sure your target’s minimum deployment version is set to iOS 17 before resolving the package.
2
Add NSMicrophoneUsageDescription to Info.plist
So that your app can access the microphone, open your target’s This string will be shown to the user in the system permission prompt.
Info.plist and add the following key if not present:3
Configure the SDK with your API key
Call Replace
Candid.configure(_:) once at launch, typically in your App initialiser or application(_:didFinishLaunchingWithOptions:). Pass a Candid.Configuration value with your project API key:your_api_key with the key shown in your Candid project settings. You can optionally pass reward, recordingDuration, stepTimings, and appearance to the same initialiser to customise the session, see Configuration for details.To identify the current participant, call Candid.setUserId(_:) at any time, for example once the user logs in:4
Attach the overlay to your root view
Candid presents its session UI in a transparent full-screen overlay. Attach it once at the root of your SwiftUI view hierarchy using the For UIKit apps, attach the overlay to your root view controller instead:Place
.candidOverlay() modifier:.candidOverlay() (or attachUIKitOverlay) at the outermost level so the overlay covers the entire screen during a session without being clipped by child view geometry.5
Register a trigger
Call
Candid.register(trigger:) wherever you want to trigger a study:Candid.register(trigger:)presents the study overlay automatically if it applies. Candid walks the participant through permissions, tasks, recording, and upload without any further code on your side.6
Confirm the integration is done correctly
In your dashboard, click on New Study, type a random question in Task 1, keep Rollout to 100%, and type your trigger name. Then, click on
Create Study, then Run Study. Build your app, launch it and navigate until your trigger is registered. Your study should now show: complete it and you will see the result session on your dashboard.