PSPDFApplePencilDriver


@interface PSPDFApplePencilDriver : NSObject <PSPDFStylusDriver>

When this class is enabled on PSPDFStylusManager compatible annotations types may be created only with touches of type UITouchTypeStylus. If enabled and a compatible annotation tool is selected, users can annotate with Apple Pencil while taping and scrolling as normal with finger touches. Compatible annotations types are ink, lines, polylines, polygons, and markup types like highlight.

  • Whether an Apple Pencil has been detected in the lifetime of the process. This should be accessed only on the main thread. PSPDFKit sets this to YES whenever a touch of type UITouchTypeStylus begins on a page view. This may be set earlier to show Apple Pencil availability in the UI sooner.

    Declaration

    Objective-C

    @property (getter=wasDetected, assign, readwrite, nonatomic, class)
        BOOL detected;

    Swift

    class var wasDetected: Bool { get set }
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFApplePencilDriver : NSObject <PSPDFStylusDriver>
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFApplePencilDriver : NSObject <PSPDFStylusDriver>
  • Creates a new instance of the driver and sets delegate.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDelegate:
        (nonnull id<PSPDFStylusDriverDelegate>)delegate;

    Swift

    init(delegate: PSPDFStylusDriverDelegate)
  • Delegate to be notified when Apple Pencil connection status changes (when a touch from one is detected). Other methods in PSPDFStylusDriverDelegate are not applicable and will not be called.

    Declaration

    Objective-C

    @property (readwrite, nonatomic)
        id<PSPDFStylusDriverDelegate> _Nullable delegate;

    Swift

    weak var delegate: PSPDFStylusDriverDelegate? { get set }