PSPDFAnnotationTableViewController


@interface PSPDFAnnotationTableViewController
    : PSPDFSearchableTableViewController <PSPDFDocumentInfoController,
                                          PSPDFStyleable>

Shows an overview of all annotations in the current document. - note: The toolbar/navigation items are populated in viewWillAppear: and can be changed in your subclass.

  • The annotation table view delegate.

    Declaration

    Objective-C

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

    Swift

    @IBOutlet weak var delegate: PSPDFAnnotationTableViewControllerDelegate? { get set }
  • Set to filter custom annotations. By default this is nil, which means it uses the editableAnnotationTypes' value of this class. This set takes strings likePSPDFAnnotationStringHighlight,PSPDFAnnotationStringInk`, …

    Note

    If neither is set, all annotations will be visible except link annotations.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable)
        NSSet<PSPDFAnnotationString> *visibleAnnotationTypes;

    Swift

    var visibleAnnotationTypes: Set
  • Usually this property should mirror what is set in PSPDFConfiguration.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable)
        NSSet<PSPDFAnnotationString> *editableAnnotationTypes;

    Swift

    var editableAnnotationTypes: Set
  • Allow to long-press to copy the annotation. Defaults to YES.

    Declaration

    Objective-C

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

    Swift

    var allowCopy: Bool { get set }
  • Allow to delete all annotations via a button. Defaults to YES. - note: This button is hidden if there are no editableAnnotationTypes set in the document.

    Declaration

    Objective-C

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

    Swift

    var showDeleteAllOption: Bool { get set }
  • Reloads the displayed annotations and updates the internal cache.

    Declaration

    Objective-C

    - (void)reloadData;

    Swift

    func reloadData()
  • Customize to make more fine-grained changes to the displayed annotation than what would be possible via setting visibleAnnotationTypes. The result will be cached internally and only refreshed after reloadData is called. (the one on this controller, NOT on the table view).

    Warning

    this method might be called from a background thread.

    Declaration

    Objective-C

    - (nonnull NSArray<__kindof PSPDFAnnotation *> *)annotationsForPageAtIndex:
        (NSUInteger)pageIndex;

    Swift

    func annotationsForPage(at pageIndex: UInt) -> [PSPDFAnnotation]
  • Queries the cache to get the annotation for indexPath.

    Declaration

    Objective-C

    - (nullable PSPDFAnnotation *)
    annotationForIndexPath:(nonnull NSIndexPath *)indexPath
               inTableView:(nonnull UITableView *)tableView;

    Swift

    func annotation(for indexPath: IndexPath, inTableView tableView: Any!) -> PSPDFAnnotation?

    Parameters

    indexPath

    The index path of the annotation.

    tableView

    The table view of the annotation. Is either equal to self.tableView or it is the table view of the search view controller.

    Return Value

    The annotation that is shown in the passed in table view at the specified index path.

  • Invoked by the clear all button.

    Declaration

    Objective-C

    - (void)deleteAllAction:(nonnull id)sender;

    Swift

    @IBAction func deleteAllAction(_ sender: Any)
  • Returns a view that wraps the %tu Annotations counter. Subclass to customize or return something custom/nil.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) UIView *viewForTableViewFooter;

    Swift

    var viewForTableViewFooter: NSView? { get }