I am using a library TTGSnackbar in iOS that is written in swift and I have used -Swift.h header to use swift library in objective C.
You can find TTGSnackbar here: http://cocoadocs.org/docsets/TTGSnackbar/0.2.2/
let snackbar = TTGSnackbar(message: "TTGSnackBar !",
duration: .middle,
actionText: "Action!",
actionBlock: { (snackbar) in
print("Click action!")
})
snackbar.show()
I am stuck while calling action block of ttg library. Ho do I achieve that in objective C? So far what I have done is (and it gives me bug at action block):
TTGSnackbar *ttg = [[TTGSnackbar alloc]init];
ttg.actionText = @"OK";
ttg.message = [[remoteMessage appData]valueForKey:@"message"];
ttg.actionTextColor = [UIColor redColor];
ttg.duration = TTGSnackbarDurationForever;
ttg.actionBlock(TTGSnackbar * _Nonnull^{})
[ttg show];
I wnat TTGSnackbar to dismiss on click of OK button