Delegate for Searching in PDF Document with Sending Notifications on Search Events

Description: class implementing a protocol for searching in PDF document with sending notifications on search events.

The SearchDelegateWithNotifications.h File

#import <Foundation/Foundation.h>
#import "MAProceduralReportDataViewController.h"
// Class implementing a delegate protocol for searching in PDF document with sending notifications on search events
@interface SearchDelegateWithNotifications : NSObject<PdfSearchDelegate>
// Executes operations required on finding specified text on page
- (void) foundOnPageIndex:(int)index;
// Executes operations required after finishing search in PDF document
- (void) searchFinished;
@end

The SearchDelegateWithNotifications.m File

#import "SearchDelegateWithNotifications.h"
@implementation SearchDelegateWithNotifications
// Executes operations required on finding specified text on page
- (void) foundOnPageIndex:(int)index
{     // Sends notification about found match with specified string in regular report     [[NSNotificationCenter defaultCenter] postNotificationName:@"resultsCountChanged" object:nil]; } // executes operations required after finishing search in PDF document - (void) searchFinished
{     // Sends notification on search finish     [[NSNotificationCenter defaultCenter] postNotificationName:@"searchFinished" object:nil]; } @end

See also:

Calculation of Search Results Number by Regular Report