BPKSnackbar
@interface BPKSnackbar : UIView
A snackbar is a piece of UI displayed at the bottom edge of the window which is useful to show notifications and other feedback on actions the user has just taken.
Users can also take contextual actions for example undoing the change that caused the snackbar to be displayed.
-
Creates a new Snackbar instance and shows it into the screen
Declaration
Objective-C
- (nonnull instancetype)initWithText:(nonnull NSString *)text title:(NSString *_Nullable)title duration:(BPKSnackbarDuration)duration viewController:(nonnull UIViewController *)viewController delegate: (id<BPKSnackbarDelegate> _Nullable)delegate;Swift
init(text: String, title: String?, duration: BPKSnackbarDuration, viewController: UIViewController, delegate: BPKSnackbarDelegate?)Parameters
textThe text displayed next to the title
titleThe optional content that is displayed in the snackbar’s title
durationtime for the snackbar to disappear
viewControllerviewController where the snackbar will be presented
delegateclass that conform the BPKSnackbarProtocol
-
Creates a new Snackbar instance and shows it into the screen
Declaration
Objective-C
- (nonnull instancetype)initWithText:(NSString *_Nullable)text title:(NSString *_Nullable)title button:(BPKSnackbarButton *_Nullable)button leftIcon:(UIImage *_Nullable)leftIcon duration:(BPKSnackbarDuration)duration viewController:(nonnull UIViewController *)viewController delegate: (id<BPKSnackbarDelegate> _Nullable)delegate;Swift
init(text: String?, title: String?, button: BPKSnackbarButton?, leftIcon: UIImage?, duration: BPKSnackbarDuration, viewController: UIViewController, delegate: BPKSnackbarDelegate?)Parameters
textThe text displayed next to the title
titleThe optional content that is displayed in the snackbar’s title
buttonThe optional button
leftIconLeft icon displayed before the titleThe text content that is displayed inside the snackbar
durationtime for the snackbar to disappear
viewControllerviewController where the snackbar will be presented
delegateclass that conform the BPKSnackbarProtocol
-
Show the snackbar
Declaration
Objective-C
- (void)show;Swift
func show() -
Dismiss the snackbar
Declaration
Objective-C
- (void)dismiss;Swift
func dismiss()
BPKSnackbar Class Reference