PSPDFFlexibleToolbarContainer

Objective-C


@interface PSPDFFlexibleToolbarContainer : UIView

Swift

class FlexibleToolbarContainer : UIView

The flexible toolbar container holds and manages a PSPDFFlexibleToolbar instance. Its main responsibilities include toolbar anchoring and drag & drop handling. Add this view to your view hierarchy (a good candidate might be the UINavigationController’s view).

  • Attached flexible toolbar.

    Declaration

    Objective-C

    @property (nonatomic, nullable) PSPDFFlexibleToolbar *flexibleToolbar;

    Swift

    var flexibleToolbar: FlexibleToolbar? { get set }
  • A UINavigationBar or UIToolbar instance, that should be automatically hidden when the flexibleToolbar is in the PSPDFFlexibleToolbarPositionInTopBar position.

    Declaration

    Objective-C

    @property (nonatomic, weak) UIView<PSPDFSystemBar> *_Nullable overlaidBar;

    Swift

    weak var overlaidBar: (UIView & SystemBar)? { get set }
  • true when a toolbar drag is in progress, false otherwise. Only relevant if dragging is enabled on the flexibleToolbar`. KVO observable.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL dragging;

    Swift

    var dragging: Bool { get }
  • Container delegate. (Can be freely set to any receiver)

    Declaration

    Objective-C

    @property (nonatomic, weak) id<PSPDFFlexibleToolbarContainerDelegate> _Nullable containerDelegate;

    Swift

    @IBOutlet weak var containerDelegate: FlexibleToolbarContainerDelegate? { get set }
  • The background color used for anchor view. If not explicitly set the color defaults to the toolbar barTintColor, toolbar tintColor or default PSPDFKit color (first one that is set).

    Declaration

    Objective-C

    @property (nonatomic) UI_APPEARANCE_SELECTOR UIColor *anchorViewBackgroundColor;

    Swift

    var anchorViewBackgroundColor: UIColor { get set }
  • Shows the container, than calls through to the corresponding PSPDFFlexibleToolbar method (showToolbarAnimated:completion:). Also hide the overlaidBar if needed (depending on the toolbar position).

    Declaration

    Objective-C

    - (void)showAnimated:(BOOL)animated
              completion:(nullable void (^)(BOOL))completionBlock;

    Swift

    func show(animated: Bool) async -> Bool
  • Also shows the overlaidBar if it was previously hidden by the toolbar container.

    Declaration

    Objective-C

    - (void)hideAnimated:(BOOL)animated
              completion:(nullable void (^)(BOOL))completionBlock;

    Swift

    func hide(animated: Bool) async -> Bool
  • Hides the container and toolbar using hideAnimated:completion: and than removes the container from its superview. Internally used by the flick to close gesture. Should also be used by done / close buttons added to the toolbar.

    Declaration

    Objective-C

    - (void)hideAndRemoveAnimated:(BOOL)animated
                       completion:(nullable void (^)(BOOL))completionBlock;

    Swift

    func hideAndRemove(animated: Bool) async -> Bool