Blog Post

PSPDFKit 10.4 for iOS Introduces an Overhauled Undo Architecture

We’re excited to announce PSPDFKit 10.4 for iOS. This release includes a brand-new undo architecture, a bunch of new examples in our Catalog project, support for TIFF files in image documents, new customization options, bug fixes, and more.

Revamped Undo Architecture

In this release, we overhauled our undo architecture from the ground up. Previously, our undo system automatically observed model changes. This was convenient, but it caused a lot of problems when changes either were made on background threads or needed to opt out of undo tracking.

The new undo architecture now switches to an opt-in approach. This means that changes to model objects won’t be automatically recorded by PSPDFKit. Instead, the changes need to be explicitly marked for undo tracking using a new block-based API. This makes the undo system significantly more predictable and stable.

This new architecture fixes a whole host of longstanding issues with undo, in addition to opening up the door for further enhancements. One of the benefits you’ll see right away is that saving a document now preserves the undo stack, which means you can undo and redo changes at any time as long as the document is open.

We integrated the new undo system into all of our built-in UI components, so if you’re using our stock controls, there’s nothing you need to do. If you use a custom-built UI for annotation creation, deletion, or editing, then you might need to annotate some of your calls for undo. We prepared a migration guide explaining when and how to mark changes for undo tracking.

New Catalog Examples

We updated our Catalog example project with a bunch of new examples for you to check out. The most interesting ones are two new examples showcasing Instant, our collaboration engine. You can now see an Instant layers demonstration, which shows how to display different sets of annotations on a document using multiple layers. We also added a new example that displays two Instant sessions side by side. This can be used to simulate multiple users editing a document, thereby showing the collaboration part of Instant even better. Our existing Instant examples have also been overhauled with a simpler and more robust setup procedure.

Those examples can be found in the new Collaboration section in the PSPDFKit Catalog example project.

Additionally, we added a new example using SwiftUI that shows how to set up streaming a document on demand from a server.

TIFF Image Documents

In this release, the Image Documents feature gained support for showing and annotating TIFF images. This means it’s now possible to annotate images directly inside PSPDFKit in the JPEG, PNG, and TIFF file formats.

Using Image Documents, you can annotate and edit images with tools that are familiar, in a non-destructible way, so it’s always possible to edit any drawings on or changes to an image. Check out our Annotate Images guide to learn more about Image Documents.

Image Documents is a separate component that can be added to your license. Please reach out to us if you’re interested in adding this to your license, or if you want to provide feedback and feature requests related to your use case.

Various Improvements

This release also includes some other noteworthy additions, improvements, and bug fixes. One such improvement was made on the search option in the PDFDocumentPickerController UI, which will now also display annotation results across documents.

The annotation replies feature also gained new functionality via the new canShowAnnotationReviews document feature property. This can be used to easily disable the reviews UI if it’s not relevant to an application’s use case.

Finally, this release fixes an issue where sometimes pages would be incorrectly changed when zooming out in continuous page transition on a document.

To see a complete list of changes, check out the PSPDFKit 10.4 for iOS changelog.

Author
Stefan Kieleithner iOS Engineer

Stefan began his journey into iOS development in 2013 and has been passionate about it ever since. In his free time, he enjoys playing board and video games, spending time with his cats, and gardening on his balcony.

Explore related topics

Related products
Share post
Free trial Ready to get started?
Free trial