PSPDFBackForwardActionList


@interface PSPDFBackForwardActionList : NSObject

Keeps track of executed PSPDFAction instances, allowing us to navigate through the action history. - note: This class is conceptually similar to WKBackForwardList.

  • The delegate is recommended. - see: delegate

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDelegate:
        (nullable id<PSPDFBackForwardActionListDelegate>)delegate;

    Swift

    init(delegate: PSPDFBackForwardActionListDelegate?)
  • Required for normal operation of requestBack and requestForward.

    Declaration

    Objective-C

    @property (readwrite, nonatomic)
        id<PSPDFBackForwardActionListDelegate> _Nullable delegate;

    Swift

    weak var delegate: PSPDFBackForwardActionListDelegate? { get set }
  • Registers a new back or forward action, depending on the context (actions added from inside of backForwardList:requestedBackActionExecution: will be added to the forward list).

    Declaration

    Objective-C

    - (void)registerAction:(nonnull PSPDFAction *)action;

    Swift

    func register(_ action: PSPDFAction)
  • Requests execution of the top back action. Doesn’t do anything if backAction is nil. - see: requestBackToAction:

    Declaration

    Objective-C

    - (void)requestBack;

    Swift

    func requestBack()
  • Updates internal state and calls the backForwardList:requestedBackActionExecution: delegate message.

    Declaration

    Objective-C

    - (void)requestBackToAction:(nonnull PSPDFAction *)action;

    Swift

    func requestBack(to action: PSPDFAction)
  • Requests execution of the top forward action. Doesn’t do anything if forwardAction is nil. - see: requestForwardToAction:

    Declaration

    Objective-C

    - (void)requestForward;

    Swift

    func requestForward()
  • Updates internal state and calls the backForwardList:requestedForwardActionExecution: delegate message.

    Declaration

    Objective-C

    - (void)requestForwardToAction:(nonnull PSPDFAction *)action;

    Swift

    func requestForward(to action: PSPDFAction)
  • Removes all back actions.

    Declaration

    Objective-C

    - (void)resetBackList;

    Swift

    func resetBack()
  • Removes all forward actions.

    Declaration

    Objective-C

    - (void)resetForwardList;

    Swift

    func resetForwardList()
  • Removes all back and forward actions.

    Declaration

    Objective-C

    - (void)reset;

    Swift

    func reset()
  • The maximum number of actions allowed in backList. No cap will be enforced if set to 0 (the default).

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSUInteger backListCap;

    Swift

    var backListCap: UInt { get set }
  • The current top back action, if any.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) PSPDFAction *backAction;

    Swift

    var backAction: PSPDFAction? { get }
  • The current top forward action, if any.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) PSPDFAction *forwardAction;

    Swift

    var forwardAction: PSPDFAction? { get }
  • A list of all tracked back actions.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic)
        NSArray<__kindof PSPDFAction *> *_Nonnull backList;

    Swift

    var backList: [PSPDFAction] { get }
  • A list of all tracked forward actions.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic)
        NSArray<__kindof PSPDFAction *> *_Nonnull forwardList;

    Swift

    var forwardList: [PSPDFAction] { get }