PSPDFSelectionViewDelegate
Objective-C
@protocol PSPDFSelectionViewDelegate <NSObject>
Swift
protocol SelectionViewDelegate : NSObjectProtocol
Delegate for selection related events.
-
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)