PSPDFPageCell
Objective-C
@interface PSPDFPageCell : UICollectionViewCell
Swift
class PDFPageCell : UICollectionViewCell
Common superclass for various collection view cells representing PDF pages.
-
Referenced page.
Declaration
Objective-C
@property (nonatomic) PSPDFPageIndex pageIndex;
Swift
var pageIndex: PageIndex { get set }
-
Allow a margin. Defaults to
UIEdgeInsetsZero
.Declaration
Objective-C
@property (nonatomic) UIEdgeInsets edgeInsets;
Swift
var edgeInsets: UIEdgeInsets { get set }
-
Enables thumbnail shadow. defaults to NO.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isShadowEnabled) BOOL shadowEnabled;
Swift
var isShadowEnabled: Bool { get set }
-
Enable page label.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isPageLabelEnabled) 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.
-
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 (nonatomic, nullable) id<PSPDFPageCellImageLoading> imageLoader;
Swift
var imageLoader: PDFPageCellImageLoading? { get set }
-
Page label. Defaults to a label with a rounded semi-translucent background.
Declaration
Objective-C
@property (nonatomic, readonly) UILabel *_Nonnull pageLabel;
Swift
var pageLabel: UILabel { get }
-
Internal image view.
Declaration
Objective-C
@property (nonatomic, readonly) UIImageView *_Nonnull imageView;
Swift
var imageView: UIImageView { get }
-
Updates the page label.
-
Creates the shadow. Subclass to change.
Declaration
Objective-C
- (nullable UIBezierPath *)pathShadowForView:(nonnull UIView *)imageView;
Swift
func pathShadow(for imageView: UIView) -> UIBezierPath?
-
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.