PSPDFViewModePresenter

@protocol PSPDFViewModePresenter <NSObject>

Protocol for presenting a collection view with customization options.

  • Convenience initializer.

    Note

    If nil, 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: PSPDFDocument?)

    Parameters

    document

    The document.

  • Class used for thumbnails.

    Warning

    Will be ignored if the layout is not a flow layout or a subclass thereof.

    Declaration

    Objective-C

    @property (assign, readwrite, 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 YES, thumbnails are laid out in columns. Landscape pages will be smaller than portrait pages. This tends to look better. If NO, all thumbnails have approximatly the same area. Defaults to YES.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL fixedItemSizeEnabled;

    Swift

    var fixedItemSizeEnabled: Bool { get set }
  • All visible page indexes.

    Declaration

    Objective-C

    @property (readonly, nonatomic) 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;

    Swift

    func scrollToPage(at pageIndex: PageIndex, document: PSPDFDocument?, animated: Bool)

    Parameters

    pageIndex

    The page index that is to be scrolled into view. @document The document that is to be displayed. This is useful for PSPDFViewModePresenters that support multiple documents. @animated Specifies whether the scroll should be animated.