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

    - (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

    - (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: UIColor? { 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 }
  • 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 }
  • Attached delegate.

    Declaration

    Objective-C

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

    Swift

    @IBOutlet weak var delegate: PSPDFNoteAnnotationViewControllerDelegate? { 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.f]];

    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 (readonly, nonatomic) UIView *_Nonnull backgroundView;

    Swift

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

    Declaration

    Objective-C

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

    Swift

    var optionsView: 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()