PTTextSearchViewController
@interface PTTextSearchViewController : UIViewController <PTOverridable>
The PTTextSearchViewController class displays a UISearchBar
that allows the user to enter
and search text within a document.
A UIToolbar
is also shown with buttons allowing the user to navigate forwards and
backwards through the results as well as configure search options.
The view controller also provides an interface to display the search results in a UITableView
.
-
Initializes a new instance of the class.
Declaration
Objective-C
- (nonnull instancetype)initWithPDFViewCtrl: (nonnull PTPDFViewCtrl *)pdfViewCtrl;
Swift
init(pdfViewCtrl: PTPDFViewCtrl)
Parameters
pdfViewCtrl
The
PTPDFViewCtrl
instance that the control will coordinate with. -
A Boolean value indicating if the search bar should become the first responder and show the keyboard when the text search view controller appears. The default is
YES
.Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite) BOOL showsKeyboardOnViewDidAppear;
Swift
var showsKeyboardOnViewDidAppear: Bool { get set }
-
Performs a text search and highlights the results on screen.
Declaration
Objective-C
- (void)findText:(nonnull NSString *)searchString;
Swift
func findText(_ searchString: String)
-
The
PTSearchSettingsViewController
managed by this view controller.Declaration
Objective-C
@property (nonatomic, strong, readwrite) PTSearchSettingsViewController *_Nonnull searchSettingsViewController;
Swift
var searchSettingsViewController: PTSearchSettingsViewController { get set }
-
An object conforming to the PTTextSearchViewControllerDelegate protocol.
Declaration
Objective-C
@property (nonatomic, weak, readwrite, nullable) id<PTTextSearchViewControllerDelegate> delegate;
Swift
weak var delegate: PTTextSearchViewControllerDelegate? { get set }