PSPDFSpreadView


@interface PSPDFSpreadView : UIView

The spread view is responsible for laying out one or multiple page views.

It ensures the best display for the pages it is responsible for and makes sure pages are shown in the correct order (e.g. respecting the page binding).

A spread describes a collection of continuous pages that are grouped in a logical container from the layout. E.g. if you have a book, when the book is open you will always see two pages next to each other. These two pages build one spread. If you have a stack of loose paper on the other hand, you always only see one page, so a spread only consists of one page in that example.

  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFSpreadView : UIView
  • The layout this spread view is a part of.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) PSPDFDocumentViewLayout *layout;

    Swift

    var layout: PSPDFDocumentViewLayout? { get }
  • The spread represented by this view.

    To convert the spread index to the range of pages that it represents, use the methods provided by the layout.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSInteger spreadIndex;

    Swift

    var spreadIndex: Int { get }
  • The page views maintained by this spread view.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic)
        NSArray<PSPDFPageView *> *_Nonnull pageViews;

    Swift

    var pageViews: [PSPDFPageView] { get }
  • Iterates through pageViews to find the page view for pageIndex.

    Declaration

    Objective-C

    - (nullable PSPDFPageView *)pageViewForPageAtIndex:(NSUInteger)pageIndex;

    Swift

    func pageViewForPage(at pageIndex: UInt) -> PSPDFPageView?

    Parameters

    pageIndex

    The index of the page for which the page view is required.

    Return Value

    The PSPDFPageView displaying the page at pageIndex.