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.
  • Accesses the configuration object.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) PSPDFConfiguration *_Nonnull configuration;

    Swift

    @NSCopying var configuration: PSPDFConfiguration { get }
  • Access the PSPDFKit singleton store.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFKit *_Nonnull pspdfkit;

    Swift

    var pspdfkit: PSPDFKit { get }
  • The displaying view controller and popover/half modal controllers.

    Declaration

    Objective-C

    @property (readonly, nonatomic)
        UIViewController *_Nonnull displayingViewController;

    Swift

    var displayingViewController: UIViewController { get }
  • 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 }
  • Inset for the scroll view.

    Declaration

    Objective-C

    @property (readonly, nonatomic) UIEdgeInsets scrollViewInsets;

    Swift

    var scrollViewInsets: UIEdgeInsets { get }
  • Inset for the scroll indicators.

    Declaration

    Objective-C

    @property (readonly, nonatomic) UIEdgeInsets scrollIndicatorInsets;

    Swift

    var scrollIndicatorInsets: UIEdgeInsets { get }
  • Defines if the frame shoulb be adjus

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL shouldAdjustFrameWhenHUDIsPersistent;

    Swift

    var shouldAdjustFrameWhenHUDIsPersistent: Bool { get }
  • Defines if we are currently in double page mode.

    Declaration

    Objective-C

    @property (readonly, getter=isDoublePageMode, nonatomic) BOOL doublePageMode;

    Swift

    var isDoublePageMode: Bool { get }
  • Defines if scrolling is enabled.

    Declaration

    Objective-C

    @property (readonly, getter=isScrollingEnabled, nonatomic) BOOL scrollingEnabled;

    Swift

    var isScrollingEnabled: Bool { get }
  • Defines if the view is locked, therefore disabling all scrolling and zooming.

    Declaration

    Objective-C

    @property (readonly, getter=isViewLockEnabled, nonatomic) BOOL viewLockEnabled;

    Swift

    var isViewLockEnabled: Bool { 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 HUD is visible.

    Declaration

    Objective-C

    @property (readonly, getter=isHUDVisible, nonatomic) BOOL HUDVisible;

    Swift

    var isHUDVisible: 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 currently visible page views, while optionally laying them out.

    Declaration

    Objective-C

    - (nonnull NSArray<PSPDFPageView *> *)visiblePageViewsForcingLayout:
        (BOOL)forcingLayout;

    Swift

    func visiblePageViewsForcingLayout(_ forcingLayout: Bool) -> [PSPDFPageView]
  • 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?