iOS
ComPDFKit PDF SDK
Guides

Listen to the Changes of Block Editing

 

ComPDFKit PDF SDK offers developers an API for programmatic change of editing status, which is easy to adjust related UI effects.

 

/**
 * Called when the editing changes.
 */
- (void)PDFViewEditingOperationDidChanged:(CPDFView *)pdfView;

/**
 * Called when the selected block or selected certain area changes.
 */
- (void)PDFViewEditingSelectStateDidChanged:(CPDFView *)pdfView;

/**
 * Called when the selected text block enters the text-editing status.
 */
- (void)PDFEditingViewShouldBeginEditing:(CPDFView *)pdfView textView:(UITextView *)textView;

/**
 * Called when the selected text block ends the text-editing status.
 */
- (void)PDFEditingViewShouldEndEditing:(CPDFView *)pdfView textView:(UITextView *)textView;


When selecting a text block or a certain area, you can use editStatus: of CPDFView to get the current text-editing status. The following is the introduction to each status.

CEditingSelectStateEmpty Does not enter the text-editing status.

CEditingSelectStateEditTextArea Selects a text block without entering the text-editing status.

CEditingSelectStateEditNoneText Enters the text-editing status without selecting text.

CEditingSelectStateEditSelectText Enters the text-editing status and selects text.