PSPDFSelectionViewDelegate

Objective-C

@protocol PSPDFSelectionViewDelegate<NSObject>

@optional

/// Called before we start selecting. If we return NO here, no selection will be drawn (but delegates will still be called)
- (BOOL)selectionView:(PSPDFSelectionView *)selectionView shouldStartSelectionAtPoint:(CGPoint)point;

/// Rect is updated. (`touchesMoved:`)
- (void)selectionView:(PSPDFSelectionView *)selectionView updateSelectedRect:(CGRect)rect;

/// Called when a rect was selected successfully. (`touchesEnded:`)
- (void)selectionView:(PSPDFSelectionView *)selectionView finishedWithSelectedRect:(CGRect)rect;

/// Called when rect selection was cancelled. (`touchesCancelled:`)
- (void)selectionView:(PSPDFSelectionView *)selectionView cancelledWithSelectedRect:(CGRect)rect;

/// Called when we did a single tap in the selection view (via tap gesture recognizer)
- (void)selectionView:(PSPDFSelectionView *)selectionView singleTappedWithGestureRecognizer:(UITapGestureRecognizer *)gestureRecognizer;

@end

Swift

protocol SelectionViewDelegate : NSObjectProtocol

Undocumented

  • Called before we start selecting. If we return NO here, no selection will be drawn (but delegates will still be called)

    Declaration

    Objective-C

    - (BOOL)selectionView:(nonnull PSPDFSelectionView *)selectionView
        shouldStartSelectionAtPoint:(CGPoint)point;

    Swift

    optional func selectionView(_ selectionView: SelectionView, shouldStartSelectionAt point: CGPoint) -> Bool
  • Rect is updated. (touchesMoved:)

    Declaration

    Objective-C

    - (void)selectionView:(nonnull PSPDFSelectionView *)selectionView
        updateSelectedRect:(CGRect)rect;

    Swift

    optional func selectionView(_ selectionView: SelectionView, updateSelectedRect rect: CGRect)
  • Called when a rect was selected successfully. (touchesEnded:)

    Declaration

    Objective-C

    - (void)selectionView:(nonnull PSPDFSelectionView *)selectionView
        finishedWithSelectedRect:(CGRect)rect;

    Swift

    optional func selectionView(_ selectionView: SelectionView, finishedWithSelectedRect rect: CGRect)
  • Called when rect selection was cancelled. (touchesCancelled:)

    Declaration

    Objective-C

    - (void)selectionView:(nonnull PSPDFSelectionView *)selectionView
        cancelledWithSelectedRect:(CGRect)rect;

    Swift

    optional func selectionView(_ selectionView: SelectionView, cancelledWithSelectedRect rect: CGRect)
  • Called when we did a single tap in the selection view (via tap gesture recognizer)

    Declaration

    Objective-C

    - (void)selectionView:(nonnull PSPDFSelectionView *)selectionView
        singleTappedWithGestureRecognizer:
            (nonnull UITapGestureRecognizer *)gestureRecognizer;

    Swift

    optional func selectionView(_ selectionView: SelectionView, singleTappedWith gestureRecognizer: UITapGestureRecognizer)