PSPDFTextSearchDelegate
Objective-C
@protocol PSPDFTextSearchDelegate <NSObject>
Swift
protocol TextSearchDelegate : NSObjectProtocol
Search status delegate. All delegates are guaranteed to be called within the main thread.
-
Called when search is started.
Declaration
Objective-C
- (void)willStartSearch:(nonnull PSPDFTextSearch *)textSearch term:(nonnull NSString *)searchTerm isFullSearch:(BOOL)isFullSearch;
Swift
optional func willStart(_ textSearch: TextSearch, term searchTerm: String, isFullSearch: Bool)
-
Search was updated, a new page has been scanned. Consider
page
a hint. There might be situations where this is called with a larger set of search results. page in this case is set toNSNotFound
.Declaration
Objective-C
- (void)didUpdateSearch:(nonnull PSPDFTextSearch *)textSearch term:(nonnull NSString *)searchTerm newSearchResults:(nonnull NSArray<PSPDFSearchResult *> *)searchResults pageIndex:(PSPDFPageIndex)pageIndex;
Swift
optional func didUpdate(_ textSearch: TextSearch, term searchTerm: String, newSearchResults searchResults: [SearchResult], pageIndex: PageIndex)
-
Called when a text search operation was aborted due to an error.
Declaration
Objective-C
- (void)didFailSearch:(nonnull PSPDFTextSearch *)textSearch withError:(nonnull NSError *)error;
Swift
optional func didFail(_ textSearch: TextSearch, withError error: Error)
Parameters
textSearch
The text search operation which was stopped.
error
The error for which it was stopped.
-
Search has finished.
Declaration
Objective-C
- (void)didFinishSearch:(nonnull PSPDFTextSearch *)textSearch term:(nonnull NSString *)searchTerm searchResults:(nonnull NSArray<PSPDFSearchResult *> *)searchResults isFullSearch:(BOOL)isFullSearch pageTextFound:(BOOL)pageTextFound;
Swift
optional func didFinish(_ textSearch: TextSearch, term searchTerm: String, searchResults: [SearchResult], isFullSearch: Bool, pageTextFound: Bool)
-
Search has been cancelled.
Declaration
Objective-C
- (void)didCancelSearch:(nonnull PSPDFTextSearch *)textSearch term:(nonnull NSString *)searchTerm isFullSearch:(BOOL)isFullSearch;
Swift
optional func didCancel(_ textSearch: TextSearch, term searchTerm: String, isFullSearch: Bool)