Looking at the the android API, there is addCallback() to know when the toast message is dismissed. Is there a similar API hook for the pod? I looked through the source and didn't see anything obvious.
thanks
Yes! You can use the completion handler.
Sorry for commenting on this closed issue but how would I use that exactly? Is there a example somewhere?
In SnackbarSimpleExample, you can assign the completion handler block directly to the message. Be careful of introducing retain cycles if you retain the snackbar message!
- (void)showSimpleSnackbar:(id)sender {
MDCSnackbarMessage *message = [[MDCSnackbarMessage alloc] init];
message.text = @"Snackbar Message";
// Added this assignment to demonstrate completion blocks.
message.completionHandler = ^(BOOL userInitiated) {
NSLog(@"Hello, world!");
};
[MDCSnackbarManager showMessage:message];
}
Wow! Thank you for the this quick and informative response. Great work.
You're welcome. Thanks for checking out MDC-iOS!
Most helpful comment
In SnackbarSimpleExample, you can assign the completion handler block directly to the message. Be careful of introducing retain cycles if you retain the snackbar message!