PSPDFPageControls

@protocol PSPDFPageControls <NSObject>

Protocol for handling page changes.

  • Set the page to a specific page index.

    Declaration

    Objective-C

    - (void)setPageIndex:(PSPDFPageIndex)pageIndex animated:(BOOL)animated;

    Swift

    func setPageIndex(_ pageIndex: PageIndex, animated: Bool)

    Parameters

    pageIndex

    Page index of the page that should be shown.

    animated

    Defines if changing the page should be animated.

  • Set the view mode.

    Declaration

    Objective-C

    - (void)setViewMode:(PSPDFViewMode)viewMode animated:(BOOL)animated;

    Swift

    func setViewMode(_ viewMode: PSPDFViewMode, animated: Bool)

    Parameters

    viewMode

    View mode to change to.

    animated

    Defines if changing the view mode should be animated.

  • Executes a passed in action.

    Declaration

    Objective-C

    - (BOOL)executePDFAction:(nullable PSPDFAction *)action
                  targetRect:(CGRect)targetRect
                   pageIndex:(PSPDFPageIndex)pageIndex
                    animated:(BOOL)animated
             actionContainer:(nullable id)actionContainer;

    Swift

    func execute(_ action: PSPDFAction?, targetRect: CGRect, pageIndex: PageIndex, animated: Bool, actionContainer: Any?) -> Bool

    Parameters

    action

    The action to execute.

    targetRect

    The rect that triggered this action in the receiver’s view coordinate space.

    animated

    YES if the transition the action is describing should be animated.

    pageIndex

    The page index to link to in the back action.

    actionContainer

    The sender that triggered the execution of this action, such as an annotation or a button.

    Return Value

    YES if the action or at least one of its subactions was executed, NO otherwise.

  • Search for a specific string.

    Declaration

    Objective-C

    - (void)searchForString:(nullable NSString *)searchText
                    options:(nullable NSDictionary<NSString *, id> *)options
                     sender:(nullable id)sender
                   animated:(BOOL)animated;

    Swift

    func search(for searchText: String?, options: [String : Any]? = nil, sender: Any?, animated: Bool)
  • Document action executer responsible for handling actions.

    Declaration

    Objective-C

    @property (readonly, nonatomic)
        PSPDFDocumentActionExecutor *_Nonnull documentActionExecutor;

    Swift

    var documentActionExecutor: PSPDFDocumentActionExecutor { get }
  • Presents the document info view controller.

    Declaration

    Objective-C

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

    Swift

    func presentDocumentInfoViewController(options: [String : Any]? = nil, sender: Any?, animated: Bool, completion: (() -> Void)? = nil) -> Any!
  • Allows file preview using QuickLook.

    Declaration

    Objective-C

    - (void)
    presentPreviewControllerForURL:(nonnull NSURL *)fileURL
                             title:(nullable NSString *)title
                           options:(nullable NSDictionary<NSString *, id> *)options
                            sender:(nullable id)sender
                          animated:(BOOL)animated
                        completion:(nullable void (^)(void))completion;

    Swift

    func presentPreviewController(for fileURL: URL, title: String?, options: [String : Any]? = nil, sender: Any?, animated: Bool, completion: (() -> Void)? = nil)
  • Reloads the displayed controller and view.

    Declaration

    Objective-C

    - (void)reloadData;

    Swift

    func reloadData()