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) BOOL showsKeyboardOnViewDidAppear;

    Swift

    var showsKeyboardOnViewDidAppear: Bool { get set }
  • The color with which to highlight the active search result.

    Declaration

    Objective-C

    @property (nonatomic, strong) UIColor *_Nonnull activeSearchResultColor;

    Swift

    var activeSearchResultColor: UIColor { get set }
  • The color with which to highlight the non-active search results.

    Declaration

    Objective-C

    @property (nonatomic, strong) UIColor *_Nonnull searchResultColor;

    Swift

    var searchResultColor: UIColor { 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)

    Parameters

    searchString

    The string to search.

  • Performs a text search and highlights the results on screen.

    Declaration

    Objective-C

    - (void)findText:(nonnull NSString *)searchString
        withSearchMode:(PTTextSearchModes)searchMode;

    Swift

    func findText(_ searchString: String, withSearchMode searchMode: PTTextSearchModes)

    Parameters

    searchString

    The string to search.

    searchMode

    The PTTextSearchModes to search.

  • The search mode1 to use when performing a text search. This property is a combination of PTTextSearchModes.

    The default search mode is e_ptambient_string | e_ptpage_stop | e_pthighlight

    Declaration

    Objective-C

    @property (nonatomic) unsigned int searchMode;

    Swift

    var searchMode: UInt32 { get set }
  • A Boolean value indicating if the search settings button is shown in the search bar. The default is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL searchSettingsEnabled;

    Swift

    var searchSettingsEnabled: Bool { get set }
  • The toolbar at the bottom of the view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIToolbar *_Nonnull searchToolbar;

    Swift

    var searchToolbar: UIToolbar { get }
  • The PTSearchSettingsViewController managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTSearchSettingsViewController *_Nonnull searchSettingsViewController;

    Swift

    var searchSettingsViewController: PTSearchSettingsViewController { get set }
  • Toggles the popup list of search results.

    Declaration

    Objective-C

    - (void)toggleListView;

    Swift

    func toggleListView()
  • An object conforming to the PTTextSearchViewControllerDelegate protocol.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<PTTextSearchViewControllerDelegate> delegate;

    Swift

    weak var delegate: PTTextSearchViewControllerDelegate? { get set }