PSPDFAnnotationTableViewController
Objective-C
@interface PSPDFAnnotationTableViewController
: PSPDFSearchableTableViewController <PSPDFDocumentInfoController,
PSPDFSegmentImageProviding,
PSPDFStyleable, PSPDFOverridable>
Swift
class AnnotationTableViewController : SearchableTableViewController, DocumentInfoController, SegmentImageProviding, Styleable, Overridable
Shows an overview of all annotations in the current document.
Note
The toolbar/navigation items are populated inviewWillAppear:
and can be changed in your subclass.
-
The annotation table view delegate.
Declaration
Objective-C
@property (nonatomic, weak) id<PSPDFAnnotationTableViewControllerDelegate> _Nullable delegate;
Swift
@IBOutlet weak var delegate: AnnotationTableViewControllerDelegate? { 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 like
PSPDFAnnotationStringHighlight,
PSPDFAnnotationStringInk`, …Note
If neither is set, all annotations will be visible except link annotations.Declaration
Objective-C
@property (nonatomic, copy, nullable) NSSet<PSPDFAnnotationString> *visibleAnnotationTypes;
Swift
var visibleAnnotationTypes: Set<Annotation.Tool>? { get set }
-
Usually this property should mirror what is set in
PDFConfiguration
. When presented by PSPDFKit, this will be set toPSPDFConfiguration.editableAnnotationTypes
excluding links.Declaration
Objective-C
@property (nonatomic, copy, nullable) NSSet<PSPDFAnnotationString> *editableAnnotationTypes;
Swift
var editableAnnotationTypes: Set<Annotation.Tool>? { get set }
-
Whether the user can long press to copy the title. Defaults to
true
.Declaration
Objective-C
@property (nonatomic) BOOL allowCopy;
Swift
var allowCopy: Bool { get set }
-
Whether the user can edit the list. Defaults to
true
.Declaration
Objective-C
@property (nonatomic) BOOL allowEditing;
Swift
var allowEditing: Bool { get set }
-
An array of custom bar button items to display on the right (or trailing) side.
Declaration
Objective-C
@property (nonatomic, copy) NSArray<UIBarButtonItem *> *_Nonnull rightActionButtonItems;
Swift
var rightActionButtonItems: [UIBarButtonItem] { get set }
-
An array of custom bar button items to display on the left (or leading) side.
Declaration
Objective-C
@property (nonatomic, copy) NSArray<UIBarButtonItem *> *_Nonnull leftActionButtonItems;
Swift
var leftActionButtonItems: [UIBarButtonItem] { get set }
-
Whether to show a button that lets the user delete all annotations. Defaults to
true
.Note
This button is hidden if there are noeditableAnnotationTypes
set in the document.Declaration
Objective-C
@property (nonatomic) BOOL showDeleteAllOption;
Swift
var showDeleteAllOption: Bool { get set }
-
Defines if the annotation table view controller allows changing the annotation’s z-index by showing a reorder control on the annotation cells in edit mode.
When presented from within PSPDFKit, this is usually set to
allowAnnotationZIndexMoves
of the usedPDFConfiguration
.Defaults to YES.
Declaration
Objective-C
@property (nonatomic) BOOL allowAnnotationZIndexMoves;
Swift
var allowAnnotationZIndexMoves: Bool { get set }
-
Reloads the displayed annotations and updates the internal cache.
-
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 afterreloadData
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: (PSPDFPageIndex)pageIndex;
Swift
func annotationsForPage(at pageIndex: PageIndex) -> [Annotation]
-
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, in tableView: UITableView) -> Annotation?
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)
-
Invoked when the user confirms the deletion of all annotations.
Declaration
Objective-C
- (void)clearOrDeleteAllAnnotations;
Swift
func clearOrDeleteAllAnnotations()
-
Returns a view that wraps the “%tu Annotations” counter. Subclass to customize or return something custom/nil.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) UIView *viewForTableViewFooter;
Swift
var viewForTableViewFooter: UIView? { get }
-
Update action buttons