> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# iOS installation

> [!NOTE]
>
> If you're looking for information on how to integrate the SDK, check out our
> [Universal Checkout](https://primer.io/docs/checkout/overview.md) integration guide.

> [!NOTE]
>
> 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](https://primer.io/docs/sdk/ios/v2.x.x/migrate-from-cocoapods.md).

## With Swift Package Manager

Swift Package Manager is built into Xcode. To add PrimerSDK with Swift Package Manager:

1. Select your project, and then navigate to `Package Dependencies`
2. Click on the **+** button at the bottom-left of the `Packages` section
3. Paste `https://github.com/primer-io/primer-sdk-ios` into the **Search Bar**
4. Press **Add Package**
5. Let Xcode download the package and set everything up

From PrimerSDK 2.28.0, the package includes 3D Secure (`Primer3DS`). You don't add it separately.

### Payment method libraries

Klarna, NOL Pay, ACH via Stripe and iPay88 need a separate Primer library. Swift Package Manager cannot make a library optional. So PrimerSDK has a separate version for each library, and that version adds the library for you.

To add a library, set the dependency rule to **Exact Version**. Enter your PrimerSDK version followed by the suffix for the library:

| Payment method | Library | Suffix |
| - | - | - |
| Klarna | `PrimerKlarnaSDK` | `-3ds-klarna` |
| NOL Pay | `PrimerNolPaySDK` | `-3ds-nolpay` |
| ACH via Stripe | `PrimerStripeSDK` | `-3ds-stripe` |
| iPay88 | `PrimerIPay88MYSDK` | `-3ds-ipay88` |

For example, for Klarna with PrimerSDK 2.53.1, enter `2.53.1-3ds-klarna`. The `-3ds-nolpay`, `-3ds-stripe` and `-3ds-ipay88` versions exist from PrimerSDK 2.54.0.

* Don't add the library as a separate package. The version with the suffix already includes it, and adding both is unreliable.
* Always use **Exact Version**. With **Up to Next Major Version**, Swift Package Manager picks the version without the library.
* When you update PrimerSDK, change the version by hand. Keep the same suffix.
* Each version includes one library. No version includes two.

## With CocoaPods (deprecated)

> [!WARNING]
>
> CocoaPods is deprecated for native iOS apps. You can use it with the Primer spec repo for a limited time. To move to Swift Package Manager, follow [Migrate from CocoaPods to Swift Package Manager](https://primer.io/docs/sdk/ios/v2.x.x/migrate-from-cocoapods.md).

Add the following to your `Podfile` file:

```ruby RUBY theme={"dark"}
source 'https://github.com/primer-io/primer-sdk-ios-specs.git'
source 'https://cdn.cocoapods.org/'

use_frameworks!

target 'MyApp' do

  # Add this line
  pod 'PrimerSDK'

  # ...

end
```

> [!NOTE]
>
> 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.

Then run `pod install` to install PrimerSDK on your workspace.

> [!NOTE]
>
> In case you encounter an error that the bundle needs signing on Xcode 14, add the following post-install script in your podfile.
>
> ```ruby RUBY theme={"dark"}
> post_install do |installer|
>   installer.pods_project.targets.each do |target|
>     if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
>       target.build_configurations.each do |config|
>           config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
>       end
>     end
>   end
> end
> ```

> [!NOTE]
>
> For more details about SDK versions, please see our
> [changelog](https://primer.io/docs/changelogs/ios-sdk.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.