PSPDFFlexibleToolbarContainer


@interface PSPDFFlexibleToolbarContainer : 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). - see: PSPDFFlexibleToolbar

  • Attached flexible toolbar.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable)
        PSPDFFlexibleToolbar *flexibleToolbar;

    Swift

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

    Declaration

    Objective-C

    @property (readwrite, nonatomic) UIView<PSPDFSystemBar> *_Nullable overlaidBar;
  • YES when a toolbar drag is in progress, NO otherwise. Only relevant if dragging is enabled on the flexibleToolbar`. KVO observable.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL dragging;

    Swift

    var dragging: Bool { get }
  • When enabled, it allows the toolbar to be dismissed by flicking it downwards during a drag & drop operation.

    Declaration

    Objective-C

    @property (getter=isFlickToCloseEnabled, assign, readwrite, nonatomic)
        BOOL flickToCloseEnabled;

    Swift

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

    Declaration

    Objective-C

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

    Swift

    @IBOutlet weak var containerDelegate: PSPDFFlexibleToolbarContainerDelegate? { 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 (assign, readwrite, nonatomic)
        UIColor *_Nonnull anchorViewBackgroundColor;

    Swift

    var anchorViewBackgroundColor: NSColor { 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, completion completionBlock: ((Bool) -> Void)? = nil)
  • 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, completion completionBlock: ((Bool) -> Void)? = nil)
  • 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, completion completionBlock: ((Bool) -> Void)? = nil)