PSPDFAnnotationPresenting

Objective-C

@protocol PSPDFAnnotationPresenting <NSObject>

Swift

protocol AnnotationPresenting : NSObjectProtocol

Conforming to this protocol indicates instances can present an annotation and react to events such as page show/hide (to pause video, for example)

  • Represented annotation this object is presenting.

    Declaration

    Objective-C

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

    Swift

    optional var annotation: PSPDFAnnotation? { get set }
  • Allows ordering of annotation views.

    Declaration

    Objective-C

    @optional
    @property (nonatomic, assign, unsafe_unretained, readwrite) NSUInteger zIndex;

    Swift

    optional var zIndex: UInt { get set }
  • Allows adapting to the outer zoomScale. Re-set after zooming.

    Declaration

    Objective-C

    @optional
    @property (nonatomic, assign, unsafe_unretained, readwrite) CGFloat zoomScale;

    Swift

    optional var zoomScale: CGFloat { get set }
  • Allows adapting to the initial pdfScale

    Declaration

    Objective-C

    @optional
    @property (nonatomic, assign, unsafe_unretained, readwrite) CGFloat PDFScale;

    Swift

    optional var pdfScale: CGFloat { get set }
  • Called when pageView is about to be displayed.

    Declaration

    Objective-C

    - (void)willShowPageView:(nonnull PSPDFPageView *)pageView;

    Swift

    optional func willShow(_ pageView: PSPDFPageView)
  • Called when pageView is hidden.

    Declaration

    Objective-C

    - (void)didHidePageView:(nonnull PSPDFPageView *)pageView;

    Swift

    optional func didHide(_ pageView: PSPDFPageView)
  • Called initially and when the parent page size is changed. (e.g. rotation)

    Declaration

    Objective-C

    - (void)didChangePageBounds:(CGRect)bounds;

    Swift

    optional func didChangePageBounds(_ bounds: CGRect)
  • Called when the user taps on an annotation and the tap wasn’t processed otherwise.

    Declaration

    Objective-C

    - (void)didTapAtPoint:(CGPoint)point;

    Swift

    optional func didTap(at point: CGPoint)
  • Queries the view if removing should be in sync or happen instantly. If not implemented, return YES is assumed.

    Declaration

    Objective-C

    @optional
    @property (nonatomic, readonly) BOOL shouldSyncRemovalFromSuperview;

    Swift

    optional var shouldSyncRemovalFromSuperview: Bool { get }
  • View is queued for being removed, but still waits for a page sync. This is called regardless of what is returned in shouldSyncRemovalFromSuperview.

    Declaration

    Objective-C

    - (void)willRemoveFromSuperview;

    Swift

    optional func willRemoveFromSuperview()
  • A weak reference to the page view responsible for this view.

    Declaration

    Objective-C

    @optional
    @property (nonatomic, weak, readwrite) PSPDFPageView *_Nullable pageView;

    Swift

    weak optional var pageView: PSPDFPageView? { get set }
  • A reference to the used configuration.

    Declaration

    Objective-C

    @optional
    @property (nonatomic, assign, unsafe_unretained, readwrite)
        PSPDFConfiguration *_Nonnull configuration;

    Swift

    optional var configuration: PSPDFConfiguration { get set }
  • Indicates if the view is selected.

    Declaration

    Objective-C

    @optional
    @property (nonatomic, assign, unsafe_unretained, readwrite, getter=isSelected)
        BOOL selected;

    Swift

    optional var isSelected: Bool { get set }
  • Width of the border of this annotation view.

    Declaration

    Objective-C

    @optional
    @property (nonatomic, assign, unsafe_unretained, readwrite) CGFloat strokeWidth;

    Swift

    optional var strokeWidth: CGFloat { get set }
  • Border color of the annotation view.

    Declaration

    Objective-C

    @optional
    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        UIColor *borderColor;

    Swift

    optional var borderColor: UIColor? { get set }
  • Placeholder for the annotation until the actual content becomes available.

    Declaration

    Objective-C

    @optional
    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        PSPDFAnnotationPlaceholder *annotationPlaceholder;

    Swift

    optional var annotationPlaceholder: PSPDFAnnotationPlaceholder? { get set }