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 }
  • The color with which to highlight the active search result.

    Declaration

    Objective-C

    @property (nonatomic, strong, readwrite)
        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, readwrite) 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.

  • A Boolean value indicating if the search settings button is shown in the search bar. The default is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        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, 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 }