PSPDFPresentationActions

@protocol PSPDFPresentationActions <NSObject>

Methods to present/dismiss view controllers. UIViewController doesn’t expose enough to conveniently present/dismiss controllers, so this protocol extends it.

  • Presents a view controller using the specified options. - note: If the presentation is blocked (e.g. return NO on the shouldShow delegate), the completion block will not be called. - warning: The presented view controller’s presentationController and popoverPresentationController should not be accessed before calling this method, because the presentation style or transitioning delegate may change. If you need to configure the popover presentation, set values in the options with keys PSPDFPresentationRectBlockKey, PSPDFPresentationPopoverArrowDirectionsKey, and PSPDFPresentationPopoverPassthroughViewsKey.

    Declaration

    Objective-C

    - (BOOL)presentViewController:(nonnull UIViewController *)viewController
                          options:(nullable NSDictionary<NSString *, id> *)options
                         animated:(BOOL)animated
                           sender:(nullable id)sender
                       completion:(nullable void (^)(void))completion;

    Swift

    func presentViewController(_ viewController: Any!, options: [String : Any]? = nil, animated: Bool, sender: Any?, completion: (() -> Void)? = nil) -> Bool
  • Dismisses a view controller of class controllerClass that was previously presented with presentViewController:options:animated:sender:completion:. If controllerClass is nil then view controllers of any class may be dismissed.

    Declaration

    Objective-C

    - (BOOL)dismissViewControllerOfClass:(nullable Class)controllerClass
                                animated:(BOOL)animated
                              completion:(nullable void (^)(void))completion;

    Swift

    func dismissViewController(of controllerClass: AnyClass?, animated: Bool, completion: (() -> Void)? = nil) -> Bool