PSPDFKit 11.3 Migration Guide
This guide covers updating an iOS or Mac Catalyst project from PSPDFKit 11.2 for iOS to PSPDFKit 11.3 for iOS. We encourage you to update as soon as possible, in order to take advantage of future new features and fixes.
New Store for Saved Annotations
This change is related to the Saved Annotations feature that lets your users store and reuse their frequently used annotations. You can skip this part if the Saved Annotations feature is disabled in your app.
With PSPDFKit 11.3 for iOS, we introduced
PersistentAnnotationSetStore as the new default implementation of the
AnnotationSetStore protocol, replacing the old
Due to the built-in limitations of the keychain services, the old keychain-based store was able to store only up to 4 KB of data. This much data could be easily filled by saving a handful of complex ink annotations or even just one high-quality image annotation. We found that exceeding this limit could occasionally corrupt the keychain entry and result in the loss of your Saved Annotations.
PersistentAnnotationSetStore stores the Saved Annotations list in your app’s
Application Support directory with file protection enabled. It doesn’t have any memory limit beyond the available storage space of the device.
The list of Saved Annotations your users previously added to the old keychain-based store will automatically be moved to the new
PersistentAnnotationSetStore to make sure it continues to be accessible.
Going forward, the new
PersistentAnnotationSetStore is our recommended implementation of the Saved Annotations store. It’s enabled by default, so there’s nothing you need to do to start using it.
However, if your app absolutely requires the extra bit of security that comes from storing the Saved Annotations list in the keychain, you can opt into it by setting the old keychain-based store as a default one during your app’s startup:
SavedAnnotationsViewController.sharedAnnotationStore = KeychainAnnotationSetsStore()
Please note that continued use of
KeychainAnnotationSetsStore increases the risk of exceeding the 4 KB memory limit by your users and, as a result, increases the risk of them losing access to their Saved Annotations list.
Refer to our Knowledge Base article to learn more about how to programmatically modify the list of Saved Annotations in your app.