PSPDFViewModePresenter
Objective-C
@protocol PSPDFViewModePresenter <NSObject>
Swift
protocol ViewModePresenter : NSObjectProtocol
Protocol for presenting a collection view with customization options.
-
Convenience initializer.
Note
Ifnil
, a controller specific default layout is selected.Declaration
Objective-C
- (nonnull instancetype)initWithCollectionViewLayout: (nullable UICollectionViewLayout *)layout;
Swift
init(collectionViewLayout layout: UICollectionViewLayout?)
Parameters
layout
The layout to use when loading the collection view.
-
Convenience initializer. Initializes the controller with the default layout and stores the document.
Declaration
Objective-C
- (nonnull instancetype)initWithDocument:(nullable PSPDFDocument *)document;
Swift
init(document: Document?)
Parameters
document
The document.
-
Current edited document.
Declaration
Objective-C
@property (nonatomic, nullable) PSPDFDocument *document;
Swift
var document: Document? { get set }
-
Used to access the configuration, class overrides, etc.
Declaration
Objective-C
@property (nonatomic, weak) id<PSPDFPresentationContext> _Nullable presentationContext;
Swift
weak var presentationContext: PresentationContext? { get set }
-
Class used for thumbnails.
Warning
Will be ignored if the layout is not a flow layout or a subclass thereof.Declaration
Objective-C
@property (nonatomic) Class _Nonnull cellClass;
Swift
var cellClass: AnyClass { get set }
-
A Boolean value specifying whether the thumbnails should be displayed in consistently spaced columns, or with consistent areas. For documents where all pages are the same size, this setting has no effect. If
true
, thumbnails are laid out in columns. Landscape pages will be smaller than portrait pages. This tends to look better. Iffalse
, all thumbnails have approximately the same area. Defaults totrue
.Declaration
Objective-C
@property (nonatomic) BOOL fixedItemSizeEnabled;
Swift
var fixedItemSizeEnabled: Bool { get set }
-
All visible page indexes.
Declaration
Objective-C
@property (nonatomic, readonly) NSIndexSet *_Nonnull visiblePageIndexes;
Swift
var visiblePageIndexes: IndexSet { get }
-
Scrolls the receiver’s content to the specified page index.
Declaration
Objective-C
- (void)scrollToPageAtIndex:(PSPDFPageIndex)pageIndex document:(nullable PSPDFDocument *)document animated:(BOOL)animated;
Parameters
pageIndex
The page index that is to be scrolled into view. @document The document that is to be displayed. This is useful for
PSPDFViewModePresenter
s that support multiple documents. @animated Specifies whether the scroll should be animated.