PSPDFFlexibleToolbarContainerDelegate

Objective-C

@protocol PSPDFFlexibleToolbarContainerDelegate <NSObject>

Swift

protocol FlexibleToolbarContainerDelegate : NSObjectProtocol

Delegate for the flexible toolbar container.

  • The toolbar container will be displayed (called before showAnimated:completion: is performed).

    Declaration

    Objective-C

    - (void)flexibleToolbarContainerWillShow:
        (nonnull PSPDFFlexibleToolbarContainer *)container;

    Swift

    optional func flexibleToolbarContainerWillShow(_ container: FlexibleToolbarContainer)
  • The toolbar container has been displayed (called after showAnimated:completion: is performed).

    Declaration

    Objective-C

    - (void)flexibleToolbarContainerDidShow:
        (nonnull PSPDFFlexibleToolbarContainer *)container;

    Swift

    optional func flexibleToolbarContainerDidShow(_ container: FlexibleToolbarContainer)
  • The toolbar container will be hidden (called before hideAnimated:completion: is performed). Will also be called in response to a flick to close gesture.

    Declaration

    Objective-C

    - (void)flexibleToolbarContainerWillHide:
        (nonnull PSPDFFlexibleToolbarContainer *)container;

    Swift

    optional func flexibleToolbarContainerWillHide(_ container: FlexibleToolbarContainer)
  • The toolbar container has been hidden (called after hideAnimated:completion: is performed). Will also be called in response to a flick to close gesture. Use this callback to perform any additional cleanup on the toolbar presenter side.

    Declaration

    Objective-C

    - (void)flexibleToolbarContainerDidHide:
        (nonnull PSPDFFlexibleToolbarContainer *)container;

    Swift

    optional func flexibleToolbarContainerDidHide(_ container: FlexibleToolbarContainer)
  • Use this method to prove a more appropriate display area for the toolbar.

    Note

    The provided CGRect should be in the containers coordinate system. Used during toolbar and anchor placeholder positioning. Defaults to self.bounds` if not implemented.

    Declaration

    Objective-C

    - (CGRect)flexibleToolbarContainerContentRect:
                  (nonnull PSPDFFlexibleToolbarContainer *)container
                               forToolbarPosition:
                                   (PSPDFFlexibleToolbarPosition)position;

    Swift

    optional func flexibleToolbarContainerContentRect(_ container: FlexibleToolbarContainer, for position: FlexibleToolbar.Position) -> CGRect
  • The toolbar is dragged and might change position.

    Declaration

    Objective-C

    - (void)flexibleToolbarContainerWillStartDragging:
        (nonnull PSPDFFlexibleToolbarContainer *)container;

    Swift

    optional func flexibleToolbarContainerWillStartDragging(_ container: FlexibleToolbarContainer)
  • The toolbar has been dragged and might have updated the position.

    Declaration

    Objective-C

    - (void)flexibleToolbarContainerDidEndDragging:
                (nonnull PSPDFFlexibleToolbarContainer *)container
                                      withPosition:
                                          (PSPDFFlexibleToolbarPosition)position;

    Swift

    optional func flexibleToolbarContainerDidEndDragging(_ container: FlexibleToolbarContainer, with position: FlexibleToolbar.Position)