MRDBottomSheetDelegate Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | MRDBottomSheetProtocols.h |
Overview
Delegation to the parent view controller of the sheet or the child view controllers that are placed inside the sheet. This allows them to react to certain adjustments and actions that can come from users.
MRDBottomSheetViewController makes a best effort to position its own view in a way that will not obstruct the keyboard. Position your content within MRDBottomSheetViewController’s view frame.
– scrollStateDidChangeToEnabled:
Lets the delegate know the sheet has changed height and if scrolling is suggested to be used within. This allows the delegate to know when they should be locked to avoid interfering with dragging gestures.
- (void)scrollStateDidChangeToEnabled:(BOOL)scrollEnabled
Parameters
scrollEnabled |
Should enable scroll on any child views. |
---|
Declared In
MRDBottomSheetProtocols.h
– sheetWillDismiss
Alerts the delegate that the sheet will become hidden.
- (void)sheetWillDismiss
Discussion
Note: When this is called the sheet will still be in the view hierarchy, even if offscreen. Use bottomSheet:didRemoveChild: to be notified when the sheet is no longer in the view hierarchy.
Declared In
MRDBottomSheetProtocols.h
– sheetDidDismiss
Alerts the delegate that the sheet has become hidden.
- (void)sheetDidDismiss
Discussion
Note: When this is called the sheet will still be in the view hierarchy, even if offscreen. Use bottomSheet:didRemoveChild: to be notified when the sheet is no longer in the view hierarchy.
Declared In
MRDBottomSheetProtocols.h
– bottomSheet:willRemoveChild:
Alerts the delegate that the bottom sheet close button has been clicked. The delegate should respond with YES if the bottom sheet should be dismissed.
- (BOOL)bottomSheet:(nonnull MRDBottomSheetViewController *)sheetViewController willRemoveChild:(nullable MRDBottomSheetAbstractController *)childViewController
Parameters
sheetViewController |
The BottomSheetViewController parent to childViewController. |
---|---|
childViewController |
The SheetAbstractController child of sheetViewController. |
Declared In
MRDBottomSheetProtocols.h
– bottomSheet:didRemoveChild:
The sheet and its child were actually removed from the view hierarchy
- (void)bottomSheet:(nonnull MRDBottomSheetViewController *)sheetViewController didRemoveChild:(nullable MRDBottomSheetAbstractController *)childViewController
Parameters
sheetViewController |
The BottomSheetViewController parent to childViewController. |
---|---|
childViewController |
The SheetAbstractController child of sheetViewController. |
Declared In
MRDBottomSheetProtocols.h
– sheetHeightDidChangeToCompletion:
Alerts the delegate that the height changed to the given height.
- (void)sheetHeightDidChangeToCompletion:(CGFloat)newHeight
Parameters
newHeight |
The bottom sheet’s new height. |
---|
Declared In
MRDBottomSheetProtocols.h
– snapPointsForContainerBounds:
Gives the delegate a hook to compute its own snap points, otherwise MRDBottomSheetViewController will make a best effort to determine them.
- (nullable MRDBottomSheetSnapPoints *)snapPointsForContainerBounds:(CGRect)bounds
Parameters
bounds |
The bounds the sheet is contained within. |
---|
Declared In
MRDBottomSheetProtocols.h