PSPDFPageControls

@protocol PSPDFPageControls <NSObject>

Protocol for handling page changes.

  • Set the page to a specific page index.

    Declaration

    Objective-C

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

    Swift

    func setPageIndex(_ pageIndex: UInt, 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.

  • Execute an action.

    Declaration

    Objective-C

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

    Swift

    func execute(_ action: PSPDFAction?, targetRect: CGRect, pageIndex: UInt, animated: Bool, actionContainer: Any?) -> Bool
  • 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()