PSPDFApplePencilManager


@interface PSPDFApplePencilManager : NSObject

Tracks the state of use of the Apple Pencil.

This class should not be instantiated manually but fetched from the PSPDFKitGlobal shared object.

  • Whether or not an Apple Pencil has been detected by the system.

    PSPDFKit automatically sets this to YES when an Apple Pencil is used to draw, or select annotations in a document.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL detected;

    Swift

    var detected: Bool { get set }
  • If YES, sets applePencilEnabled to YES whenever PSPDFApplePencilDetectedNotification is posted, resulting in enabling Apple Pencil whenever a touch from one is detected.

    Defaults to YES.

    Note

    Setting this property does not directly set applePencilEnabled, so if you want to disable Apple Pencil and disable automatic enabling, you should set both properties to NO, and if you want to enable Apple Pencil immediately and re-enable automatic enabling, you should set both properties to YES.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL enableOnDetection;

    Swift

    var enableOnDetection: Bool { get set }
  • Enables/disables the use of the Apple Pencil, if it has been detected.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL enabled;

    Swift

    var enabled: Bool { get set }