PSPDFPresentationContext

@protocol PSPDFPresentationContext <
    PSPDFOverridable, PSPDFVisiblePagesDataSource, PSPDFErrorHandler>

The presentation context is used to provide several parts of the framework with information about what is currently presented in the corresponding PSPDFViewController.

Note

You should never implement PSPDFPresentationContext yourself, instead it is created by the framework and handed to you in several places when needed.
  • The associated document.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) PSPDFDocument *document;

    Swift

    var document: PSPDFDocument? { get }
  • Current view mode;

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFViewMode viewMode;

    Swift

    var viewMode: PSPDFViewMode { get }
  • Frame for the visible content, without navigation bar, status bar, side bar.

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGRect contentRect;

    Swift

    var contentRect: CGRect { get }
  • Defines if a rotation is currently happening.

    Declaration

    Objective-C

    @property (readonly, getter=isRotationActive, nonatomic) BOOL rotationActive;

    Swift

    var isRotationActive: Bool { get }
  • Defines if the user interface is visible.

    Declaration

    Objective-C

    @property (readonly, getter=isUserInterfaceVisible, nonatomic)
        BOOL userInterfaceVisible;

    Swift

    var isUserInterfaceVisible: Bool { get }
  • Defines if viewWillAppear is currently being called.

    Declaration

    Objective-C

    @property (readonly, getter=isViewWillAppearing, nonatomic)
        BOOL viewWillAppearing;

    Swift

    var isViewWillAppearing: Bool { get }
  • Defines if the view is currently reloading.

    Declaration

    Objective-C

    @property (readonly, getter=isReloading, nonatomic) BOOL reloading;

    Swift

    var isReloading: Bool { get }
  • Defines if the view is loaded.

    Declaration

    Objective-C

    @property (readonly, getter=isViewLoaded, nonatomic) BOOL viewLoaded;

    Swift

    var isViewLoaded: Bool { get }
  • Currently visible page views.

    Declaration

    Objective-C

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

    Swift

    var visiblePageViews: [PSPDFPageView] { get }
  • Returns the page view for the given page index. Will return nil if the page view is not loaded.

    Declaration

    Objective-C

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

    Swift

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