PSPDFStylusDriver

@protocol PSPDFStylusDriver <NSObject>

Abstract driver class for various styli.

  • Undocumented

    Declaration

    Objective-C

    @protocol PSPDFStylusDriver <NSObject>
  • Creates a new instance of the driver with delegate set.

    Declaration

    Objective-C

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

    Swift

    init(delegate: PSPDFStylusDriverDelegate)
  • Enable a stylus driver.

    Declaration

    Objective-C

    - (BOOL)enableDriverWithOptions:(nullable NSDictionary<NSString *, id> *)options
                              error:(NSError *_Nullable *_Nullable)error;

    Swift

    func enable(options: [String : Any]? = nil) throws
  • Disable the current stylus driver.

    Declaration

    Objective-C

    - (void)disableDriver;

    Swift

    func disableDriver()
  • Info of the connected stylus. Might also return data if the connection status is not connected.

    Declaration

    Objective-C

    @property (readonly, nonatomic)
        NSDictionary<PSPDFConnectedStylusInfoKey, id> *_Nonnull connectedStylusInfo;

    Swift

    var connectedStylusInfo: [PSPDFConnectedStylusInfoKey : Any] { get }
  • Connection status of the pen managed by the driver.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFStylusConnectionStatus connectionStatus;

    Swift

    var connectionStatus: PSPDFStylusConnectionStatus { get }
  • Driver event delegate.

    Declaration

    Objective-C

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

    Swift

    weak var delegate: PSPDFStylusDriverDelegate? { get }
  • Optional touch classification.

    Declaration

    Objective-C

    - (nullable id<PSPDFStylusTouch>)touchInfoForTouch:(nonnull UITouch *)touch;

    Swift

    optional func touchInfo(for touch: UITouch) -> PSPDFStylusTouch?
  • Returns a settings/pairing controller, if the driver supports this.

    Declaration

    Objective-C

    @optional
    @property (readonly, nonatomic, nullable) UIViewController *settingsController;

    Swift

    optional var settingsController: UIViewController? { get }
  • Undocumented

    Declaration

    Objective-C

    @protocol PSPDFStylusDriver <NSObject>
  • View registration. (optional, not all drivers need this)

    Declaration

    Objective-C

    - (void)registerView:(nonnull UIView *)view;

    Swift

    optional func register(_ view: UIView)
  • Undocumented

    Declaration

    Objective-C

    @protocol PSPDFStylusDriver <NSObject>