PSPDFKit 10.3 Migration Guide
This guide covers updating an iOS or Mac Catalyst project from PSPDFKit 10.2 for iOS to PSPDFKit 10.3 for iOS. We expect this to be a fast and easy upgrade. We encourage you to update as soon as possible to take advantage of future new features and fixes.
This release adds support for the Optimize Interface for Mac setting for Mac Catalyst apps. If you previously weren’t using the setting because of PSPDFKit, you can now enable it.
If you implement an object conforming to the
SignatureStore protocol, then you no longer need to implement
storeName because these requirements were moved to our concrete implementation,
KeychainSignatureStore. The name of a store was never read by PSPDFKit.
The store name parameter may now be omitted when initializing a
KeychainSignatureStore. The default store name will be used in this case. In other words, you can change
KeychainSignatureStore(storeName: KeychainSignatureStore.DefaultStoreName) to
There are a few API changes that may require straightforward updates. Please attempt to compile your project after updating PSPDFKit. If you encounter any compiler errors where your project calls PSPDFKit APIs, then you can find the recommended migration approaches below. If there are no compiler errors, then no integration changes are necessary.
Error handling has been added to the
DataProviding protocol. The
data property has been replaced by the
data() throwing function, and
readData(withSize:atOffset:) is now a throwing function. These both return
NSError by reference in Objective-C. Please update your implementation to account for the possibility of errors occurring.
Furthermore, the deprecated
replace(with:) has been removed. Please use the renamed alternative
MenuItem.identifier property has been changed from read-write to read-only because identifiers should not be changed. Please set the identifier when initializing the object.
All initializers of
init(document:) have been marked as unavailable. Please ensure you use
init(document:). Note that using any other initializer in a previous version of PSPDFKit would not have worked at runtime anyway.
The type of the
PDFConfiguration.signatureStore property has changed from required to optional because there can now be no signature store set. If you’re reading this property, please account for the possibility of
nil — such as with optional chaining or force unwrapping — if you’re sure you’ve set this to a non-
UIHostingView class has been removed. This was a general helper for SwiftUI and UIKit interoperability. Please use your own helper for this instead, such as the one from the SwiftUIX project.
This release adds the Electronic Signatures component. If you use the older signing functionality as part of the Annotations component and would like to update to Electronic Signatures, please see our guide on Migrating to Electronic Signatures. If you continue to use the older signing functionality, then no integration changes are necessary.