PSPDFInlineSearchManager


@interface PSPDFInlineSearchManager : NSObject

PSPDFInlineSearchManager manages the presentation of a search bar that may be used to find text in a PSPDFDocument. The search bar sides down from the top, typically covering the navigation bar.

  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFInlineSearchManager : NSObject
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFInlineSearchManager : NSObject
  • Designated initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPresentationContext:
        (nonnull id<PSPDFPresentationContext>)presentationContext;

    Swift

    init(presentationContext: PSPDFPresentationContext)
  • Presents a search bar, optionally with pre-filled text. - parameter: text Text to show in the search bar initially, or nil if the bar should start empty. - parameter: animated A Boolean value specifying whether to animate the search bar sliding down from above the container view.

    Declaration

    Objective-C

    - (void)presentInlineSearchWithSearchText:(nullable NSString *)text
                                     animated:(BOOL)animated;

    Swift

    func presentInlineSearch(withSearchText text: String?, animated: Bool)

    Parameters

    text

    Text to show in the search bar initially, or nil if the bar should start empty.

    animated

    A Boolean value specifying whether to animate the search bar sliding down from above the container view.

  • Hides the previously presented search bar. - parameter: animated A Boolean value specifying whether to animate the search bar sliding up to above the container view.

    Declaration

    Objective-C

    - (BOOL)hideInlineSearchAnimated:(BOOL)animated;

    Swift

    func hideInlineSearch(animated: Bool) -> Bool

    Parameters

    animated

    A Boolean value specifying whether to animate the search bar sliding up to above the container view.

  • Hides the keyboard, but the search UI stays visible.

    Declaration

    Objective-C

    - (void)hideKeyboard;

    Swift

    func hideKeyboard()
  • Returns YES is search UI is visible. Returns yes even if search UI is currently being presented/dismissed.

    Declaration

    Objective-C

    @property (readonly, getter=isSearchVisible, nonatomic) BOOL searchVisible;

    Swift

    var isSearchVisible: Bool { get }
  • The configuration data source for this class.

    Declaration

    Objective-C

    @property (readonly, nonatomic)
        id<PSPDFPresentationContext> _Nullable presentationContext;

    Swift

    weak var presentationContext: PSPDFPresentationContext? { get }
  • Internally used PSPDFTextSearch object. (is a copy of the PSPDFTextSearch class in document)

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) PSPDFTextSearch *textSearch;

    Swift

    var textSearch: PSPDFTextSearch? { get }
  • Current searchText.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull searchText;

    Swift

    var searchText: String { get }
  • Currently loaded search results.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic)
        NSArray<PSPDFSearchResult *> *_Nonnull searchResults;

    Swift

    var searchResults: [PSPDFSearchResult] { get }
  • Current search status.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFSearchStatus searchStatus;

    Swift

    var searchStatus: PSPDFSearchStatus { get }
  • The inline search manager delegate that notifies show/hide and when a search result is focussed.

    Declaration

    Objective-C

    @property (readwrite, nonatomic)
        id<PSPDFInlineSearchManagerDelegate> _Nullable delegate;

    Swift

    weak var delegate: PSPDFInlineSearchManagerDelegate? { get set }
  • The document to be searched. Assigning a new document resets and hides the search bar.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) PSPDFDocument *document;

    Swift

    var document: PSPDFDocument? { get set }
  • The maximum number of results that may be displayed. Setting this too high may cause slowdown. Defaults to 600.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        NSUInteger maximumNumberOfSearchResultsDisplayed;

    Swift

    var maximumNumberOfSearchResultsDisplayed: UInt { get set }
  • Will include annotations that have a matching type into the search results. (contents will be searched). Defaults to PSPDFAnnotationTypeAll&~PSPDFAnnotationTypeLink. - note: Requires the PSPDFFeatureMaskAnnotationEditing feature flag.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        PSPDFAnnotationType searchableAnnotationTypes;

    Swift

    var searchableAnnotationTypes: PSPDFAnnotationType { get set }
  • Returns whether search UI is currently being presented.

    Declaration

    Objective-C

    @property (readonly, getter=isBeingPresented, nonatomic) BOOL beingPresented;

    Swift

    var isBeingPresented: Bool { get }
  • Returns whether search UI is currently being dismissed.

    Declaration

    Objective-C

    @property (readonly, getter=isBeingDismissed, nonatomic) BOOL beingDismissed;

    Swift

    var isBeingDismissed: Bool { get }
  • Specifies the top padding of the search results label. Defaults to 10.f.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat searchResultsLabelDistance;

    Swift

    var searchResultsLabelDistance: CGFloat { get set }