一个在 iOS 应用中显示消息的库,类似于 Android Snackbar 风格。
在您的 Podfile 中添加以下行
pod "YJMessage"
用法简单,类似于 TSMessages。
// basic
[YJMessage showMessageInViewController:self
title:@"Hi, there"
duration:1.5f
type:YJMessageTypeInfo];
// show message with completion callback
[YJMessage showMessageInViewController:self
title:@"hi, there"
duration:1.5f
type:YJMessageTypeInfo
callback:^() {
NSLog(@"message showed");
}];
// show message with a button
[YJMessage showMessageInViewController:self
title:@"hey, error!"
duration:1.5f
type:YJMessageTypeInfo
callback:nil
buttonTitle:@"tap me"
buttonCallback:^{
NSLog(@"Tapped.");
}];