CocoaPods Trunk stops accepting new versions on 2 December 2026. We recommend Swift Package Manager. If your app uses CocoaPods, follow Migrate from CocoaPods to Swift Package Manager.
Prerequisites
- iOS 15.0+ deployment target
- Swift 6.0+
- Xcode 16.0+
- A
clientTokenfrom your server via the Client Session API
The Primer Checkout SDK uses SwiftUI. You can drop it into a SwiftUI view hierarchy directly, or present it from UIKit with
PrimerCheckoutPresenter.Install the SDK
We recommend Swift Package Manager. CocoaPods works for a limited time, but it is deprecated for native iOS apps. Both install the samePrimerSDK framework, which includes the Checkout Components UI.
This is a beta release line. The current version is
3.0.0-beta.9. Pin to the exact beta version so a new beta tag does not change your build without you opting in.With Swift Package Manager
Swift Package Manager is integrated into Xcode. To addPrimerSDK:
- Select your project, then navigate to Package Dependencies.
- Click the + button at the bottom-left of the Packages section.
- Paste https://github.com/primer-io/primer-sdk-ios.git into the search bar.
- Under Dependency Rule, choose Exact Version and enter the beta tag
3.0.0-beta.9. - Press Add Package and let Xcode resolve and link the dependency.
Package.swift:
With CocoaPods (deprecated)
Add the following to yourPodfile:
RUBY
Keep both
source lines at the top of your Podfile, in this order. CocoaPods Trunk accepts no new versions from 2 December 2026, so Primer publishes new versions to its own spec repo. CocoaPods takes a pod from the first source that has it, so the Primer line comes first. Once a Podfile has a source line, CocoaPods no longer adds its CDN by itself. The CDN line keeps your other pods installing. Older Primer versions are in both sources, so pod install can print Found multiple specifications for Primer pods. This is expected. CocoaPods uses the Primer spec repo, because it comes first.pod install to install PrimerSDK into your workspace:
.xcworkspace (not the .xcodeproj) from now on.
If Xcode reports that a resource bundle target needs signing, add the following post-install script to your
Podfile.RUBY
Optional: Klarna
Native Klarna appears in the payment method list only when your app includes thePrimerKlarnaSDK pod. Adyen Klarna does not need it.
The PrimerSDK Swift package for the beta does not include PrimerKlarnaSDK, so native Klarna requires CocoaPods. Add PrimerKlarnaSDK next to PrimerSDK in your Podfile, then run pod install:
RUBY
source lines, as described in With CocoaPods (deprecated).
Basic Usage
ImportPrimerSDK and present PrimerCheckout with a clientToken. This renders the SDK’s default screens as a managed modal and reports the outcome through onCompletion:
PrimerCheckout requires iOS 15.0+ and runs on the main actor. Its initializer also accepts primerSettings and primerTheme, plus two optional Apple Pay Express Checkout shipping handlers:
Verify Installation
Build and run your app to confirm the SDK is resolved and links correctly:import PrimerSDK resolves, the SDK is installed and ready to use.
Next Steps
API Overview
Tour the Checkout Components API surface
PrimerCheckout
The managed modal entry point in depth
Theming
Customize the appearance with design tokens
Handle Payment Result
Respond to success, failure, and dismissal