PSPDFTextSelectionViewDelegate

Objective-C

@protocol PSPDFTextSelectionViewDelegate <NSObject>

Swift

protocol TextSelectionViewDelegate : NSObjectProtocol

The delegate protocol for PSPDFTextSelectionView.

  • Ask the delegate whether the given glyphs should become selected.

    Declaration

    Objective-C

    - (BOOL)textSelectionView:(nonnull PSPDFTextSelectionView *)textSelectionView
             shouldSelectText:(nonnull NSString *)text
                   withGlyphs:(nonnull NSArray<PSPDFGlyph *> *)glyphs
                       atRect:(CGRect)rect;

    Swift

    optional func textSelectionView(_ textSelectionView: TextSelectionView, shouldSelectText text: String, with glyphs: [PSPDFGlyph], at rect: CGRect) -> Bool

    Return Value

    A boolean value that indicates whether the given glyphs should become selected or not.

  • Inform the delegate that the given glyphs have been selected or deselected.

    Declaration

    Objective-C

    - (void)textSelectionView:(nonnull PSPDFTextSelectionView *)textSelectionView
                didSelectText:(nonnull NSString *)text
                   withGlyphs:(nonnull NSArray<PSPDFGlyph *> *)glyphs
                       atRect:(CGRect)rect;

    Swift

    optional func textSelectionView(_ textSelectionView: TextSelectionView, didSelectText text: String, with glyphs: [PSPDFGlyph], at rect: CGRect)
  • Deprecated

    Deprecated in PSPDFKit 12.3 for iOS. Use ‘PDFViewControllerDelegate.pdfViewController(:menuForText:onPageView:appearance:suggestedMenu:)’ or ‘PDFViewControllerDelegate.pdfViewController(:menuForImage:onPageView:appearance:suggestedMenu:)’ instead.

    Ask the delegate to display a legacy menu for selected text or image.

    Warning

    This delegate method is deprecated and is no longer called. To customize the menu for selected text, use the PSPDFViewControllerDelegate/pdfViewController:menuForText:onPageView:appearance:suggestedMenu: delegate method. To customize the menu for selected image, use the PSPDFViewControllerDelegate/pdfViewController:menuForImage:onPageView:appearance:suggestedMenu: delegate method instead.

    Declaration

    Objective-C

    - (BOOL)textSelectionView:(nonnull PSPDFTextSelectionView *)textSelectionView
           updateMenuAnimated:(BOOL)animated;

    Swift

    optional func textSelectionView(_ textSelectionView: TextSelectionView, updateMenuAnimated animated: Bool) -> Bool