PSPDFDocumentPickerController


@interface PSPDFDocumentPickerController
    : PSPDFStatefulTableViewController <UISearchDisplayDelegate,
                                        UISearchBarDelegate>

Shows all documents available in the specified directory or the the documents set directly. By default this will enqueue all documents into the default PSPDFLibrary for FTS.

  • Returns an array of PSPDFDocument’s found in the directoryName directory.

    Declaration

    Objective-C

    + (nonnull NSArray<PSPDFDocument *> *)
    documentsFromDirectory:(nullable NSString *)directoryName
     includeSubdirectories:(BOOL)includeSubdirectories;

    Swift

    class func documents(fromDirectory directoryName: String?, includeSubdirectories: Bool) -> [PSPDFDocument]
  • Initializes a document picker controller for the specified directory.

    Warning

    Specifying a directory and a library with a dataSource set may result in the library’s indexes being in an inconsistent state with the data source if the documents do not match those provided by the dataSource. This is highly discouraged. IF you wish to use the picker controller for documents not already specified by the library’s dataSource, create a new library at a separate path and pass that here.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDirectory:(nullable NSString *)directory
                        includeSubdirectories:(BOOL)includeSubdirectories
                                      library:(nullable PSPDFLibrary *)library;

    Swift

    convenience init(directory: String?, includeSubdirectories: Bool, library: PSPDFLibrary?)

    Parameters

    directory

    The directory from which documents are to be retrieved for selection.

    library

    The library in which the documents are to be indexed. This is optional but required if you want to use fullTextSearchEnabled.

    Return Value

    An instance of PSPDFDocumentPickerController.

  • Initializes a document picker controller for the specified documents.

    Warning

    Specifying documents and a library with a dataSource set may result in the library’s indexes being in an inconsistent state with the data source if the documents do not match those provided by the dataSource. This is highly discouraged. IF you wish to use the picker controller for documents not already specified by the library’s dataSource, create a new library at a separate path and pass that here.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDocuments:
                                (nonnull NSArray<PSPDFDocument *> *)documents
                                      library:(nullable PSPDFLibrary *)library;

    Swift

    init(documents: [PSPDFDocument], library: PSPDFLibrary?)

    Parameters

    documents

    The documents available to be selected.

    library

    The library in which the documents are to be indexed. This is optional but required if you want to use fullTextSearchEnabled.

    Return Value

    An instance of PSPDFDocumentPickerController.

  • Manually trigger library enqueueing. We automatically do that when the controller becomes visible.

    Declaration

    Objective-C

    - (void)enqueueDocumentsIfRequired;

    Swift

    func enqueueDocumentsIfRequired()
  • Delegate to get the didSelectDocument: event.

    Declaration

    Objective-C

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

    Swift

    @IBOutlet weak var delegate: PSPDFDocumentPickerControllerDelegate? { get set }
  • All PSPDFDocument objects.

    Declaration

    Objective-C

    @property (readonly, copy, atomic) NSArray<PSPDFDocument *> *_Nonnull documents;

    Swift

    var documents: [PSPDFDocument] { get }
  • Displayed path. Might be nil, if initialized with a number of documents.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *directory;

    Swift

    var directory: String? { get }
  • Getting the PDF document title can be slow. If set to NO, the file name is used instead. Defaults to NO.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL useDocumentTitles;

    Swift

    var useDocumentTitles: Bool { get set }
  • Enables section indexes. Defaults to YES.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL showSectionIndexes;

    Swift

    var showSectionIndexes: Bool { get set }
  • If disabled, documents will only be displayed once you start searching. Defaults to YES.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL alwaysShowDocuments;

    Swift

    var alwaysShowDocuments: Bool { get set }
  • Enable to perform full-text search on all documents. Defaults to YES

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL fullTextSearchEnabled;

    Swift

    var fullTextSearchEnabled: Bool { get set }
  • If set to YES, will require an exact word match instead of an begin/end partial match. Defaults to NO. - note: This will forward the option via PSPDFLibraryMatchExactWordsOnlyKey to the PSPDFLibrary.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL fullTextSearchExactWordMatch;

    Swift

    var fullTextSearchExactWordMatch: Bool { get set }
  • Property is enabled if a FTS-Search is currently queued/running. KVO observable.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL isSearchingIndex;

    Swift

    var isSearchingIndex: Bool { get }
  • Will show the actual pages and text preview instead of just the documents. Only valid if fullTextSearchEnabled is enabled. Defaults to YES.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL showSearchPageResults;

    Swift

    var showSearchPageResults: Bool { get set }
  • Will show a preview text that presents the search term within its context. Only valid if fullTextSearchEnabled is enabled. Defaults to YES.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL showSearchPreviewText;

    Swift

    var showSearchPreviewText: Bool { get set }
  • Defaults to 600. A too high number will be slow. Only valid if fullTextSearchEnabled is enabled.

    Declaration

    Objective-C

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

    Swift

    var maximumNumberOfSearchResultsDisplayed: UInt { get set }
  • Number of results found per document. Defaults to 10. Only valid if fullTextSearchEnabled is enabled.

    Declaration

    Objective-C

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

    Swift

    var maximumNumberOfSearchResultsPerDocument: UInt { get set }
  • Maximum number of lines for search preview text. Defaults to 2. The actual number of lines will be smaller if there’s not enough preview text available. Only valid if fullTextSearchEnabled is enabled.

    Declaration

    Objective-C

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

    Swift

    var maximumNumberOfSearchPreviewLines: UInt { get set }
  • The attached library, if any.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) PSPDFLibrary *library;

    Swift

    var library: PSPDFLibrary? { get }