PSPDFKit 9.2 Migration Guide

This guide covers updating an iOS or Mac Catalyst project from PSPDFKit 9 for iOS to PSPDFKit 9.2 for iOS. We encourage you to update as soon as possible, in order to take advantage of future new features and fixes.

PSPDFKit 9.2 for iOS fully supports iOS 11, 12, and 13. iOS 11 support will be removed later during the PSPDFKit 9 lifecycle. Xcode 11.3 or later is required to use this version of the SDK. Learn more in our version support guide.

Third-Party Styluses No Longer Supported

PSPDFKit for iOS added support for third-party styluses in 2014 with the release of PSPDFKit 3.7 for iOS. Today, that comes to an end as PSPDFKit 9.2 for iOS removes support for third-party styluses to favor the much more prevalent option in 2020: Apple Pencil.

With this, we’re also simplifying our stylus-selection UI, as well as redesigning the API you can use to get notified about the status of the Apple Pencil that might be connected to the device.

The APIs that have been affected by this are listed below.

  • Removed: PSPDFStylusManager
    Use PSPDFApplePencilManager instead.
  • Removed: -[PSPDFKitGlobal stylusManager]
    Use -[PSPDFKitGlobal applePencilManager] instead.
  • Removed: PSPDFStylusViewController
    Use PSPDFApplePencilController instead.
  • Removed: PSPDFStylusDriver
    This is no longer supported.
  • Removed: PSPDFStylusDriverDelegate
    This is no longer supported.
  • Removed: PSPDFStylusTouch
    This is no longer supported.
  • Removed: PSPDFStylusTouchClassification
    This is no longer supported.
  • Removed: PSPDFStylusTouchClassificationInfo
    This is no longer supported.
  • Removed: PSPDFDefaultStylusTouch
    This is no longer supported.
  • Removed: PSPDFApplePencilDriver
    This driver’s functionality is now handled by PSPDFApplePencilManager.
  • Removed: PSPDFStylusButtonAction
    This is no longer supported.
  • Removed: PSPDFStylusManagerConnectionStatusChangedNotification
    Use PSPDFApplePencilEnabledChangedNotification to get notified when Apple Pencil is enabled/disabled.
  • Removed: PSPDFStylusStatusButton
    Use PSPDFApplePencilStatusButton instead.
  • Removed: -PSPDFAnnotationToolbar.showsStylusButtonAutomatically
    Use -PSPDFAnnotationToolbar.showsApplePencilButtonAutomatically instead.
  • Removed: -PSPDFAnnotationToolbar.showingStylusButton
    Use PSPDFAnnotationToolbar.showingApplePencilButton instead.
  • Removed: -[PSPDFAnnotationToolbar setShowingStylusButton:animated:]
    Use -[PSPDFAnnotationToolbar setShowingApplePencilButton:animated:] instead.
  • Removed: -PSPDFAnnotationToolbar.stylusButton
    Use -PSPDFAnnotationToolbar.applePencilButton instead.

Apple Pencil (first and second generation) continues to be fully supported by PSPDFKit for iOS out of the box.

Localized String Key Changes

The localized string keys for annotation types and tools have been simplified. If you’re providing a custom localization, check your use of any of the string keys below and ensure you’re using the correct keys in the correct contexts.

Before:

KeyEnglish TextUse
RedactRedactAccessibility label for text selection menu item.
RedactionRedactionType of an annotation for redaction.
NoteNoteType of an annotation for adding notes/comments.
TextTextThis was not used.
FreeTextTextType of an annotation that shows text on the page.
FileFileThis was not used.
SquiggleSquiggleThis was not used.
SquigglySquigglyType of an annotation that shows a squiggly underline.

The new localized string keys always use the annotation type names from the PDF specification. Entries for other keys listed above have been removed. You can obtain all of these keys using constants like PSPDFAnnotationStringRedaction and PSPDFAnnotationStringNote etc.

After:

KeyEnglish TextUse
RedactRedactionType of an annotation for redaction. Now also used as the accessibility label for the text selection menu.
TextNoteType of an annotation for adding notes/comments.
FreeTextTextType of an annotation that shows text on the page.
FileAttachmentFileType of an annotation that contains an embedded file.
SquigglySquiggleType of an annotation that shows a squiggly underline.