---
title: Migrate from CocoaPods to Swift Package Manager - iOS
description: Step-by-step guide to migrate your Contentsquare iOS SDK integration from CocoaPods to Swift Package Manager
source_url:
  html: https://docs.contentsquare.com/en/csq-sdk-ios/migrate-from-cocoapods/
  md: https://docs.contentsquare.com/en/csq-sdk-ios/migrate-from-cocoapods/index.md
---

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

CocoaPods is no longer supported for integrating the CSQ iOS SDK in your app.

**If you stay on CocoaPods, you will stop receiving SDK updates. Migrate to Swift Package Manager to continue receiving new features and fixes.**

## Before you begin

* Xcode 16.0 or later is required.
* Make sure you have an up-to-date copy of your project in source control before starting.

## Migration steps

### 1. Remove the Contentsquare SDK from your Podfile

Open your `Podfile` and remove the Contentsquare SDK pod reference:

```ruby
pod 'ContentsquareSDK'
```

Then run `pod install` to update your project:

```shell
pod install
```

> **Note**
>
> This approach keeps CocoaPods in your project for other dependencies. You can continue using CocoaPods alongside Swift Package Manager.

### 2. Add the Contentsquare SDK via Swift Package Manager

1. In Xcode, go to `File > Add Packages…`.

2. Enter the following repository URL:

   ```plaintext
   https://github.com/ContentSquare/apple-sdk.git
   ```

1) Set the Dependency Rule to `Exact Version` `1.13.1`.

1. Click `Add Package`.

### 3. Add the `-ObjC` linker flag

To ensure the SDK starts correctly, add `-ObjC` as a linker flag:

1. In your target's `Build Settings`, search for `Other Linker Flags`.
2. Add `-ObjC`.

### 4. Remove leftover SwiftProtobuf dependency

If you previously added `pod 'SwiftProtobuf'` to work around a known CocoaPods issue, remove that reference from your project. SwiftProtobuf is included automatically via SPM.

Also remove `https://github.com/apple/swift-protobuf.git` from `Package Dependencies` if you had added it before SDK version 4.35.1.

### 5. Build and verify

Build your project. If the build succeeds and the SDK initializes correctly, the migration is complete.

> **Tip**
>
> To verify the SDK is running, filter your Xcode or macOS Console logs by `CSLIB`.

## If you want to fully remove CocoaPods

If you're not using CocoaPods for any other dependencies and want to completely remove it from your project:

1. Run `pod deintegrate` in your project directory.
2. Delete `Podfile` and `Podfile.lock`.
3. Open the `.xcodeproj` file directly instead of the `.xcworkspace`.

> **Warning**
>
> Only do this if you have no other CocoaPods dependencies in your project.

## Troubleshooting

### Symbol not found at runtime

If you see an error like:

```text
dyld: Symbol not found: _OBJC_CLASS_$_...
```

Make sure the `-ObjC` linker flag is present under `Build Settings` > `Linking` > `Other Linker Flags` for your app target.

### Module not found at build time

If Xcode cannot find the `ContentsquareModule` import, check that the `ContentsquareSDK` package is listed under your target's `Frameworks, Libraries, and Embedded Content` in the General tab.


```json
{"@context":"https://schema.org","@type":"TechArticle","headline":"Migrate from CocoaPods to Swift Package Manager","description":"Step-by-step guide to migrate your Contentsquare iOS SDK integration from CocoaPods to Swift Package Manager","url":"https://docs.contentsquare.com/en/csq-sdk-ios/migrate-from-cocoapods/","inLanguage":"en","dateModified":"2026-07-01T21:01:22+02:00","publisher":{"@type":"Organization","name":"Contentsquare","url":"https://www.contentsquare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://docs.contentsquare.com/#website","name":"Contentsquare Technical Documentation","url":"https://docs.contentsquare.com/"}}
```