JKAlert 1.0.0

JKAlert 1.0.0

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布最新发布2017年9月

skyfox 维护。



JKAlert 1.0.0

兼容 ios7 ios8,UIAlertView 和 UIActionSheet,UIAlertViewController(ios8),用块实现回调,简单方便

##Alert用法
//JKAlert *alert = [[JKAlert alloc]initWithTitle:@"提示" andMessage:@"haha" style:JKALERT_ALERT];

JKAlert *alert = [JKAlert alertWithTitle:@"提示" andMessage:@"haha"];
[alert addCommonButtonWithTitle:@"ok0" handler:^(JKAlertItem *item) {
    NSLog(@"%@,%zd",item.title,item.tag);

}];

[alert addCommonButtonWithTitle:@"ok1" handler:^(JKAlertItem *item) {
    NSLog(@"%@,%zd",item.title,item.tag);
    
}];
[alert addCommonButtonWithTitle:@"ok2" handler:^(JKAlertItem *item) {
    NSLog(@"%@,%zd",item.title,item.tag);
    
}];
[alert addCommonButtonWithTitle:@"ok3" handler:^(JKAlertItem *item) {
    NSLog(@"%@,%zd",item.title,item.tag);
    
}];
[alert addCommonButtonWithTitle:@"ok4" handler:^(JKAlertItem *item) {
    NSLog(@"%@,%zd",item.title,item.tag);
    
}];
[alert addCancleButtonWithTitle:@"cancle" handler:^(JKAlertItem *item) {
    NSLog(@"%@,%zd",item.title,item.tag);

}];
[alert show];

##ActionSheet用法
//JKAlert *alert = [[JKAlert alloc]initWithTitle:@"提示" andMessage:@"haha" style:JKALERT_ACTION_SHEET];
JKAlert *actionSheet = [JKAlert actionSheetWithTitle:@"提示" andMessage:@"haha"];
[actionSheet addCommonButtonWithTitle:@"ok" handler:^(JKAlertItem *item) {
NSLog(@"%@,%zd",item.title,item.tag);
}];
[actionSheet addCommonButtonWithTitle:@"ok1" handler:^(JKAlertItem *item) {
NSLog(@"%@,%zd",item.title,item.tag);

}];
[actionSheet addCommonButtonWithTitle:@"ok2" handler:^(JKAlertItem *item) {
    NSLog(@"%@,%zd",item.title,item.tag);
    
}];
[actionSheet addCancleButtonWithTitle:@"cancle" handler:^(JKAlertItem *item) {
    NSLog(@"%@,%zd",item.title,item.tag);
    
}];
[actionSheet show];

##demo