MRDBottomSheetViewController Class Reference

Inherits from UIViewController
Declared in MRDBottomSheetViewController.h

Overview

A sheet that holds interactive content, usually in a table view. This has a blurry / drop shadow view that is useful for on screen interaction at the same time keeping the view it relates to in perspective.

  mediator

Delegate mediator allows anyone to register / unregister for delegation calls as there may be more than one party that needs to know about events

@property (nonatomic, nullable, strong) id<MRDBottomSheetMediator> mediator

Declared In

MRDBottomSheetViewController.h

  scrollEnabled

Whether the child content controller should be able to scroll.

@property (nonatomic, readonly) BOOL scrollEnabled

Declared In

MRDBottomSheetViewController.h

  expandable

Whether the sheet view is able to be brought to a state beyond minimum. eg: middle or maximum.

@property (nonatomic, assign) BOOL expandable

Declared In

MRDBottomSheetViewController.h

– showAtState:animated:completion:

Size the sheet appropriately for the given state, optionally animating it.

- (CGRect)showAtState:(MRDBottomSheetState)state animated:(BOOL)animated completion:(void ( ^ _Nullable ) ( void ))completionHandler

Parameters

state

Target state sheet will size to.

animated

Whether the sheet will animate to that position or snap to it instantly.

completionHandler

The block to be executed when animation completes, or if no animation is enabled executed immediately.

Return Value

the BottomSheetViewController’s new view frame

Declared In

MRDBottomSheetViewController.h

– closeAndRemove:

Moves the sheet below the bottom of the screen and hides it. Animates to the bottom if specified. Removes it from the parent controller after.

- (void)closeAndRemove:(BOOL)animated

Parameters

animated

Whether the sheet will animate to the bottom of the screen or instantly disappear.

Declared In

MRDBottomSheetViewController.h

– closeAndRemoveAnimated:forceRemoval:completion:

Moves the sheet below the bottom of the screen and hides it. Animates to the bottom if specified. Removes it from the parent controller after.

- (void)closeAndRemoveAnimated:(BOOL)animated forceRemoval:(BOOL)forced completion:(void ( ^ __nullable ) ( void ))completion

Parameters

animated

Whether the sheet will animate to the bottom of the screen or instantly disappear.

forced

YES if we should force removal even if the sheet is sticky. NO if not

completion

called on main after animation has completed and the sheet has been removed from the view hierarchy

Declared In

MRDBottomSheetViewController.h

– dragGesture:

Enable forwarding gestures by exposing the method that is used to move the sheet up and down.

- (void)dragGesture:(nonnull UIPanGestureRecognizer *)recognizer

Parameters

recognizer

UIPanGestureRecognizer that contains translation values.

Declared In

MRDBottomSheetViewController.h