PSPDFBackForwardActionList

Objective-C


@interface PSPDFBackForwardActionList : NSObject <PSPDFOverridable>

Swift

class BackForwardActionList : NSObject, Overridable

Keeps track of executed Action 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: BackForwardActionListDelegate?)
  • Required for normal operation of requestBack(animated:) and requestForward(animated:).

    Declaration

    Objective-C

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

    Swift

    weak var delegate: BackForwardActionListDelegate? { get set }
  • Registers a new back or forward action, depending on the context (actions added from inside of backForwardList(_:requestedBackActionExecution:animated:) 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:animated:

    Declaration

    Objective-C

    - (void)requestBackAnimated:(BOOL)animated;

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    See

    requestForwardToAction:animated:

    Declaration

    Objective-C

    - (void)requestForwardAnimated:(BOOL)animated;

    Swift

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

    Declaration

    Objective-C

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

    Swift

    func requestForward(to action: PSPDFAction, animated: Bool)
  • 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 (nonatomic) NSUInteger backListCap;

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

    var forwardList: [PSPDFAction] { get }