Integrating PSPDFKit Using CocoaPods
PSPDFKit is available via CocoaPods. We provide a URL for the Podspec so that you can integrate PSPDFKit with minimal effort, either pinning to a specific version or always getting the latest stable release. If you’re new to CocoaPods, this Getting Started guide will help you.
ℹ️ Note: Please don’t follow our manual integration guide if you’re using CocoaPods.
❗Important: Please make sure you have a CocoaPods version >= 1.10.0 installed. You can check your version of CocoaPods with
pod --version
.
Read on to see what you have to add to your Podfile
.
Always Use the Latest Release:
use_frameworks! target :YourTargetName do pod 'PSPDFKit', podspec: 'https://customers.pspdfkit.com/pspdfkit-ios/latest.podspec' end
Pinning to a Specific Version (e.g. 10.0.0):
use_frameworks! target :YourTargetName do pod 'PSPDFKit', podspec: 'https://customers.pspdfkit.com/pspdfkit-ios/10.0.0.podspec' end
Once you’ve completed the steps above, run pod install
. Try the demo to get started on the integration.
Use Nightly Test Builds
If you have an active license subscription, we can enable access to nightlies on CocoaPods. Once that is done, replace latest.podspec
with nightly.podspec
to point to the latest nightly build.
Use a JSON Podspec
CocoaPods makes a checksum of the JSON representation of your Podspec and keeps it in your Podfile.lock
file. If your development environment requires you to use a JSON Podspec, you can append .json
to your CocoaPods URL, like so:
use_frameworks! target :YourTargetName do pod 'PSPDFKit', podspec: 'https://customers.pspdfkit.com/pspdfkit-ios/latest.podspec.json' end
To learn more about Podspec checksums, please take a look at the Why does my team’s Podfile.lock Podspec checksums change? blog post.
Use Fat Frameworks Instead of XCFrameworks
In PSPDFKit 9.4 for iOS, we started offering XCFrameworks as CocoaPods artifacts. If your project environment requires you to use old fat .framework
files instead, you can append -framework
to the version number of your CocoaPods URL, like so:
use_frameworks! target :YourTargetName do pod 'PSPDFKit', podspec: 'https://customers.pspdfkit.com/pspdfkit-ios/latest-framework.podspec' end
dSYM Support
In PSPDFKit 7.0.3 for iOS, we added dSYM support for CocoaPods for all frameworks. CocoaPods will automatically pick up the dSYMs for improved symbolication. CocoaPods 1.3.0 or later is required.
Test Targets
You can add PSPDFKit to your test targets like this:
target :YourTargetNameTests do pod 'PSPDFKit', podspec: 'https://customers.pspdfkit.com/pspdfkit-ios/latest.podspec' end
You can also use CocoaPods inheritance mode to inherit all of your main target’s dependencies by using inherit! :complete
, like so:
target :YourTargetNameTests do inherit! :complete end