PSPDFNoteAnnotationViewController

Objective-C


@interface PSPDFNoteAnnotationViewController
    : PSPDFBaseViewController <UITextViewDelegate, PSPDFStyleable,
                               PSPDFOverridable>

Swift

class NoteAnnotationViewController : PDFBaseViewController, UITextViewDelegate, Styleable, Overridable

A view controller to view and edit the comments attached to an annotation.

Comments means the contents of the annotation and, if enabled, the contents of all replies to that annotation. Whether replies and reviews are enabled is determined by the canShowAnnotationReplies and canShowAnnotationReviews features from PSPDFDocumentFeatures respectively.

This can be used for any type of annotation. For PSPDFNoteAnnotation, additional options are displayed for setting the note’s color and icon.

  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil PSPDF_NOT_DESIGNATED_INITIALIZER_ATTRIBUTE;
  • Creates a new note annotation view controller with an annotation.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAnnotation:
        (nullable PSPDFAnnotation *)annotation;

    Swift

    init(annotation: PSPDFAnnotation?)

    Parameters

    annotation

    The annotation whose contents should be shown.

  • Creates a new note annotation view controller from Interface Builder.

    Declaration

    Objective-C

    - (nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder;

    Swift

    init?(coder decoder: NSCoder)
  • Attached annotation. All types are allowed.

    Declaration

    Objective-C

    @property (nonatomic, nullable) PSPDFAnnotation *annotation;

    Swift

    var annotation: PSPDFAnnotation? { get set }
  • The comment view’s background color.

    Declaration

    Objective-C

    @property (nonatomic, nullable) UIColor *commentBackgroundColor;

    Swift

    var commentBackgroundColor: UIColor? { get set }
  • Whether the date label should be shown.

    Declaration

    Objective-C

    @property (nonatomic) BOOL showsTimestamps;

    Swift

    var showsTimestamps: Bool { get set }
  • Whether the author name label should be shown.

    Declaration

    Objective-C

    @property (nonatomic) BOOL showsAuthorName;

    Swift

    var showsAuthorName: Bool { get set }
  • If YES, the Style button will be displayed for changing note annotation color and icon. Defaults to YES. Will be ignored if allowEditing is NO or annotation type is not PSPDFAnnotationTypeNote.

    Declaration

    Objective-C

    @property (nonatomic) BOOL showColorAndIconOptions;

    Swift

    var showColorAndIconOptions: Bool { get set }
  • Attached delegate.

    Declaration

    Objective-C

    @property (nonatomic, weak) id<PSPDFNoteAnnotationViewControllerDelegate> _Nullable delegate;

    Swift

    @IBOutlet weak var delegate: NoteAnnotationViewControllerDelegate? { get set }
  • Called as we update the text view. This can be used to update various text view properties like font.

    Note

    An even better way is to use UIAppearance: [[UITextView appearanceWhenContainedIn:PSPDFNoteAnnotationViewController.class, nil] setFont:[UIFont fontWithName:@"Helvetica" size:20.0]];

    Declaration

    Objective-C

    - (void)updateTextView:(nonnull UITextView *)textView;

    Swift

    func update(_ textView: UITextView)
  • The view used for showing the background color.

    Declaration

    Objective-C

    @property (nonatomic, readonly) UIView *_Nonnull backgroundView;

    Swift

    var backgroundView: UIView { get }
  • Called initially and every time a property changes to re-build the toolbar’s items.

    Declaration

    Objective-C

    - (void)setupToolbar;

    Swift

    func setupToolbar()
  • Called whenever text is changed and after toolbar creation. Used to control the delete button enabled state.

    Declaration

    Objective-C

    - (void)updateToolbar;

    Swift

    func updateToolbar()