PSPDFApplePencilManager

Objective-C


@interface PSPDFApplePencilManager : NSObject

Swift

class ApplePencilManager : 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 true when an Apple Pencil is used to draw, or select annotations in a document.

    Declaration

    Objective-C

    @property (nonatomic) BOOL detected;

    Swift

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

    Defaults to true.

    Note

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

    Declaration

    Objective-C

    @property (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 (nonatomic) BOOL enabled;

    Swift

    var enabled: Bool { get set }