PSPDFPageCell


@interface PSPDFPageCell : UICollectionViewCell

Common superclass for various collection view cells representing PDF pages.

  • Referenced page.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSUInteger pageIndex;

    Swift

    var pageIndex: UInt { get set }
  • Allow a margin. Defaults to UIEdgeInsetsZero.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) UIEdgeInsets edgeInsets;

    Swift

    var edgeInsets: NSEdgeInsets { get set }
  • Enables thumbnail shadow. defaults to NO.

    Declaration

    Objective-C

    @property (getter=isShadowEnabled, assign, readwrite, nonatomic)
        BOOL shadowEnabled;

    Swift

    var isShadowEnabled: Bool { get set }
  • Enable page label.

    Declaration

    Objective-C

    @property (getter=isPageLabelEnabled, assign, readwrite, nonatomic)
        BOOL pageLabelEnabled;

    Swift

    var isPageLabelEnabled: Bool { get set }
  • If something has changed that requires the image to be reloaded you can call that method. The image then will be reloaded on the next layout pass.

    Declaration

    Objective-C

    - (void)setNeedsUpdateImage;

    Swift

    func setNeedsUpdateImage()
  • The image loader the cell should use to render images.

    Note

    This is a retained object. Be sure to not create retain cycles.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) id<PSPDFPageCellImageLoading>
        imageLoader;

    Swift

    var imageLoader: PSPDFPageCellImageLoading? { get set }
  • Page label. Defaults to a label with a rounded semi-translucent background.

    Declaration

    Objective-C

    @property (readonly, nonatomic) UILabel *_Nonnull pageLabel;

    Swift

    var pageLabel: UnsafeMutablePointer
  • Internal image view.

    Declaration

    Objective-C

    @property (readonly, nonatomic) UIImageView *_Nonnull imageView;

    Swift

    var imageView: NSImageView { get }
  • Set image after your imageUpdate block gets called.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) UIImage *image;

    Swift

    var image: NSImage? { get set }
  • Creates the shadow. Subclass to change.

    Declaration

    Objective-C

    - (nullable UIBezierPath *)pathShadowForView:(nonnull UIView *)imageView;

    Swift

    func pathShadow(forView imageView: Any!) -> NSBezierPath?
  • The content rect that can be used for rendering content.

    The default implementation takes the edgeInsets into account.

    Declaration

    Objective-C

    - (CGRect)contentRectForBounds:(CGRect)bounds;

    Swift

    func contentRect(forBounds bounds: CGRect) -> CGRect

    Parameters

    bounds

    The bounds that should be used to calculate the content rect from.

    Return Value

    The calculated content rect.

  • The image rect that should be used for displaying the image.

    This will be used to calculate the frame of the internal image view.

    Declaration

    Objective-C

    - (CGRect)imageRectForContentRect:(CGRect)contentRect;

    Swift

    func imageRect(forContentRect contentRect: CGRect) -> CGRect

    Parameters

    contentRect

    The content rect in which the image rect should be positioned.

    Return Value

    The image rect where the image should be drawn.