PSPDFNoteAnnotationViewController


@interface PSPDFNoteAnnotationViewController
    : PSPDFBaseViewController <UITextViewDelegate, PSPDFStyleable>

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 are enabled is determined by the canShowAnnotationReplies feature from PSPDFDocumentFeatures.

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

  • Unavailable

    Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFNoteAnnotationViewController
        : PSPDFBaseViewController <UITextViewDelegate, PSPDFStyleable>
  • 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

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

    Swift

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

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) PSPDFAnnotation *annotation;

    Swift

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

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable)
        UIColor *commentBackgroundColor;

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

    var showsAuthorName: Bool { get set }
  • Deprecated

    Deprecated in PSPDFKit 7.5 for iOS. Use PSPDFAnnotation.isEditable or PSPDFConfiguration.editableAnnotationTypes instead.

    If NO, the text will be read-only, and changing the style, adding replies and deleting will not be possible. It is better to use annotation.isEditable or PSPDFConfiguration’s editableAnnotationTypes. Defaults to YES.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL allowEditing;
  • 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 (assign, readwrite, nonatomic) BOOL showColorAndIconOptions;

    Swift

    var showColorAndIconOptions: Bool { get set }
  • Deprecated

    Deprecated in PSPDFKit 7.5 for iOS. This is not recommend because copying text by selecting it is easy.

    Shows the copy button. Disabled by default for space reasons. (and because copying text is easy) The button will be added to the ‘…’ menu on each individual comment.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL showCopyButton;
  • Deprecated

    Deprecated in PSPDFKit 7.5 for iOS. The decision of starting to edit when presented is now made automatically based on heuristics, if the user might want to start editing.

    If enabled, we enable the edit mode during controller presentation. by calling beginEditing at the correct timing. Defaults to NO.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL shouldBeginEditModeWhenPresented;
  • Deprecated

    Deprecated in PSPDFKit 7.5 for iOS. Subclass and override updateTextView: instead.

    Can be used to customize the text view. (If UIAppearance rules are not enough)

    Note

    The text view delegate must not be changed. Instead subclass and implement the required delegate methods. Subclasses must not call super when implementing UITextViewDelegate methods. Internal logic takes care of that automatically as needed.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) UITextView *textView;
  • Attached delegate.

    Declaration

    Objective-C

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

    Swift

    @IBOutlet weak var delegate: PSPDFNoteAnnotationViewControllerDelegate? { get set }
  • Deprecated

    Deprecated in PSPDFKit 7.5 for iOS. Consider building custom UI to display an annotation’s contents instead.

    Called when we’re about to show the annotation delete menu.

    Declaration

    Objective-C

    - (void)deleteAnnotation:(nonnull UIBarButtonItem *)barButtonItem;
  • Deprecated

    Deprecated in PSPDFKit 7.5 for iOS. Consider building custom UI to display an annotation’s contents instead.

    Will delete annotation (note) or clear note text (any other type) without confirmation.

    Declaration

    Objective-C

    - (void)deleteOrClearAnnotationWithoutConfirmation;
  • Deprecated

    Deprecated in PSPDFKit 7.5 for iOS. Consider building custom UI to display an annotation’s contents instead.

    Returns the title for the delete confirmation button. Depends if the annotation is a note annotation or a different type, and if there are replies.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull deleteAnnotationActionTitle;
  • Deprecated

    Deprecated in PSPDFKit 7.5 for iOS. Consider building custom UI to display an annotation’s contents instead.

    Sets the text view as first responder and enables editing if allowed. Returns YES on success, false if not editable or first responder couldn’t be set.

    Declaration

    Objective-C

    - (BOOL)beginEditing;
  • 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.f]];

    Declaration

    Objective-C

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

    Swift

    func updateTextView(_ textView: Any!)
  • The view used for showing the background color.

    Declaration

    Objective-C

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

    Swift

    var backgroundView: NSView { get }
  • Option view (note annotations)

    Declaration

    Objective-C

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

    Swift

    var optionsView: NSView { get }
  • Deprecated

    Deprecated in PSPDFKit 7.5 for iOS. The items in the option view don’t have a border anymore.

    The border color of items in the option view.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) UIColor *borderColor;
  • 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()