MDCBottomDrawerPresentationControllerDelegate

@protocol MDCBottomDrawerPresentationControllerDelegate <
    UIAdaptivePresentationControllerDelegate>

Delegate for MDCBottomSheetPresentationController.

  • This method is called when the bottom drawer will change its presented state to one of the MDCBottomDrawerState states.

    Declaration

    Objective-C

    - (void)bottomDrawerWillChangeState:
                (nonnull MDCBottomDrawerPresentationController *)
                    presentationController
                            drawerState:(MDCBottomDrawerState)drawerState;

    Parameters

    presentationController

    presentation controller of the bottom drawer

    drawerState

    the drawer’s state

  • This method is called when the drawer is scrolled/dragged and provides a transition ratio value between 0-100% (0-1) that indicates the percentage in which the drawer is close to reaching the end of its scrolling. If the drawer is about to reach fullscreen, its percentage moves between 0-100% as it starts covering the safe area and status bar. If the drawer doesn’t reach full screen, it moves between 0-100% as it reaches 20 points away from being fully expanded.

    • 1 or 100% indicates the drawer has reached the end of its scrolling upwards to reveal content.
    • 0 or 0% indicates that there is more scrolling to be done for the drawer to either present more content or to transition to full screen.

    Declaration

    Objective-C

    - (void)bottomDrawerTopTransitionRatio:
                (nonnull MDCBottomDrawerPresentationController *)
                    presentationController
                           transitionRatio:(CGFloat)transitionRatio;

    Parameters

    presentationController

    the bottom drawer presentation controller.

    transitionRatio

    The transition ratio betwen 0-100% (0-1).