PSPDFPresentationActions
Objective-C
@protocol PSPDFPresentationActions <NSObject>
Swift
protocol PresentationActions : NSObjectProtocol
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’spresentationController
andpopoverPresentationController
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 keysPSPDFPresentationOptionSourceRectProvider
,PSPDFPresentationOptionPopoverArrowDirections
, andPSPDFPresentationOptionPopoverPassthroughViews
.Declaration
Objective-C
- (BOOL)presentViewController:(nonnull UIViewController *)viewController options: (nullable NSDictionary<PSPDFPresentationOption, id> *) options animated:(BOOL)animated sender:(nullable id)sender completion:(nullable void (^)(void))completion;
Swift
func present(_ viewController: UIViewController, options: [PresentationOption : Any]? = nil, animated: Bool, sender: Any?, completion: (() -> Void)? = nil) -> Bool
-
Dismisses a view controller of class
controllerClass
that was previously presented withpresentViewController:options:animated:sender:completion:
. IfcontrollerClass
isnil
then view controllers of any class may be dismissed.