PSPDFKit 9 for iOS

Today we’re releasing PSPDFKit 9 for iOS, our major SDK update for 2019. Version 9 brings our complete user interface to the Mac for apps using Apple’s Project Catalyst. It also introduces many great new iOS 13 features, including systemwide dark mode, multi-window support in our tabbed UI, Swift UI examples, and many other smaller tweaks. At the same time, PSPDFKit 9 retains compatibility with iOS 11 and 12. The release was compiled with Xcode 11, which enabled us to integrate our Swift wrappers directly into the main binary distribution. As with every major update, we also took some time to improve our APIs and clean up deprecations. The release comes with a migration guide that covers all the changes.

Mac Catalyst

We were thrilled to see Apple announce iPad Apps for Mac during last year’s WWDC. We immediately started experimenting with what was called Project Marzipan at the time, and we kept at it throughout the past year. Project Marzipan became public this year as Mac Catalyst, and we’re excited to be able to offer initial support for this exciting new platform with PSPDFKit 9 through our new xcframework distribution.

To learn more about PSPDFKit for Mac Catalyst, check out the separate announcement blog post and be sure to download PDF Viewer for Mac to see the framework in action once it becomes available in the Mac App Store later next month.

To ensure compatibility with Mac Catalyst, we are now distributing PSPDFKit and PSPDFKitUI in the new xcframework format. Updating from the previous frameworks is a simple process and is covered in detail in our migration guide.

Dark Mode

PSPDFKit for iOS has long supported a built-in special dark interface style via a custom solution based on UIAppearance. This, together with a custom inverted page rendering mode, made reading documents easy on the eyes in dark environments, such as in an airplane cockpit at night. While our dark interface covered the basics, it was by no means complete, as some screens still appeared in their normal light style.

iOS 13 introduces a new dark interface setting that is applied throughout the system. PSPDFKit 9 fully adopts Dark Mode in our user interface, even on views that did not previously support the dark interface style. This enhanced Dark Mode support replaces our previous solution on both iOS 13 and Mac Catalyst. The user interface will now honor the system interface style automatically, while the page rendering style can still be switched separately — either programmatically, or through the built-in settings UI.

Dark Mode is propagated throughout iOS applications with a special trait collection property: userInterfaceStyle. PSPDFKit inherits this from its host application and honors its setting, ensuring a unified look is maintained.

Multiple Windows

With iOS 13, Apple is taking a big leap forward in making the iPad an even more powerful productivity device. One of the biggest steps in this direction is that of the new multitasking features provided via support for multiple application windows. PSPDFKit 9 makes it easy to adopt multi-window support in your app through our tabbed view controller. The controller now uses system drag-and-drop gestures, which can be used to drag tabs out into new windows with minimal additional code on the host application side. You can see this in action by checking out TabbedBarExample.swift in PSPDFCatalog, as well as in the upcoming version of PDF Viewer for iOS.

SwiftUI

The biggest surprise in this year’s developer tools update was certainly the introduction of SwiftUI — an entirely new system UI framework. If you decided to be on the bleeding edge and adopted SwiftUI in your application, then good news: PSPDFKit can still be easily be integrated in your application. PSPDFKit 9 comes with a new SwiftUI Catalog example, SwiftUIExample.swift, which shows how this can be achieved. For more information, you can check out our How to Show a PDF in SwiftUI blog post.

PSPDFKitSwift

The binary distribution for PSPDFKit 9 was built as an xcframework with Xcode 11 and the Swift 5.1 compiler. The ABI and module stability offered by the new Swift compiler version enabled us to integrate our Swift wrappers directly into the shipping binary instead of having to offer them separately through the PSPDFKitSwift repository. With this change, we are deprecating PSPDFKitSwift as a standalone product, as we can now offer you great custom-tailored Swift APIs out of the box.

If you previously integrated PSPDFKitSwift into your project, you can transition by upgrading PSPDFKit and simply deleting the PSPDFKitSwift integration. For more information, please check out the migration guide.

ℹ️ Note: Since PSPDFKit now includes Swift code, be sure to enable ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES in your project if you don’t already use any Swift code in your application and are deploying to iOS 12.1 or earlier.

More Details

In addition to the changes covered above, this release also includes a large set of other smaller improvements and bug fixes. One of the more interesting ones is the new support for transparent PNG images in image and stamp annotations. On the model level, we upgraded all our main model classes that offer NSCoding to also support NSSecureCoding. Secure coding is now also used by default inside PSPDFKit for all newly created archives. In addition, the user interface received some tweaks. We refreshed the annotation toolbar design and adopted new contextual menus on iOS 13 to better show grouped annotation tools. We also updated the annotation toolbar and document editor icons so that they can be more easily distinguished from one another.

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

PSPDFKit for iOS

Download the free 60-day trial and add it to your app today.