PSPDFKit 4.0 Migration Guide
PSPDFKit 4 is a major new release and includes many new features and a few breaking changes. It is the first release that was re-thought from the ground up with iOS 8 in mind (backwards compatible to iOS 7), and we were able to redesign many aspects that were suboptimal in PSPDFKit v3 due to the iOS 5/6 requirement.
Starting with PSPDFKit 4.0, you will need iOS 7.0 upwards and Xcode 6.0 (SDK 8) to compile. Your apps can be written in Objective-C or Swift.
We also require
UIViewControllerBasedStatusBarAppearance to be set to YES. This is the default behavior for any app since iOS 7 but Apple allows you to customize this behavior. PSPDFKit v3 supported both modes of operation, but since view controller based status bar appearance clearly is the future, we will focus on that.
The PSPDFKit 4 demo now requires a license both for the demo and for the licensed versions. This changed has been made in response to people having issues with entering the license key. Use our web site to obtain a demo key while you're evaluating. If you are just testing PSPDFCatalog, no custom keys are required.
The document model in 4.0 is now immutable for data sources. This allows faster internal code handling. If you need to late-change data sources for your document, create a new document by using the
documentByAppendingObjects: helper that will accept
NSData or a
We modernized the view controller API and removed several properties that were no longer in line with iOS 7:
UIAppearance to customize colors and tint throughout PSPDFKit instead. See our article about Appearance styling for details.
Most properties, including the
overrideClass:withClass: method have been moved to the new
PSPDFConfiguration object, which better defines when configuration changes should be done and also allows you to archive/export complete configuration sets. See PSPDFCatalog for examples how to use
setUpdateSettingsForRotationBlock: has been replaced with the more generic
setUpdateSettingsForBoundsChangeBlock:. Ask the
PSPDFViewController to get the current interface rotation.
The status bar is now managed by view controllers and as such by your
UINavigationController-subclass. Therefore, we completely deleted
PSPDFStatusBarStyle and the matching
statusBarStyleSetting property. This is now controlled by the navigation bar style set in your
UINavigationController. We added a new property
shouldHideStatusBar to the
PSPDFViewController that controls the status bar appearance globally in all used view controllers as a convenience method for you.
PSPDFAnnotationToolbar has been removed in favor of the more modern and flexible
PSPDFFlexibleAnnotationToolbar that we introduced in PSPDFKit 3.6. To simplify things, we renamed this new, modern toolbar to
PSPDFAnnotationToolbar. You will have to update your code if you used a subclass of the old class.
Digital Signing Architecture
We greatly updated the signing architecture to allow signing using PKI hardware and remove signatures. Many internal classes have been updated and improved.
We've made various changes to the way annotations and other data are now archived via
NSKeyedArchiver. PSPDFKit is downwards compatible and can read it's own format starting with version 3.0. You need to make sure that older installations don't try to parse the PSPDFKit 4 data format, as they will loose certain information from the PSPDFKit 4 data format.
PSPDFURLConnection has been completely removed in favor of
NSURLSession. If your code was using this internal class, please update your calls or use something like
PSPDFIndexSetFromArray() has been replaced by a category in PSPDFCatalog, See
Many classes now work independently of the
PSPDFViewController. A new
PSPDFPresentationContext protocol has been introduced that defines a subset of the
PSPDFViewController to make these internal components reusable.