Latest 1.0.0
Homepage https://github.com/shaojiankui/JKAlert
License MIT
Platforms ios , requires ARC
Authors

兼容 ios7 ios8的 ,UIAlertView and UIActionSheet,UIAlertViewController(ios8),Block实现回调,简单方便

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

JKAlert

Latest podspec

{
    "name": "JKAlert",
    "version": "1.0.0",
    "summary": "u517cu5bb9 iOS7 iOS8u7684 ,UIAlertView and UIActionSheet,UIAlertViewController(ios8),Blocku5b9eu73b0u56deu8c03,u7b80u5355u65b9u4fbf",
    "homepage": "https://github.com/shaojiankui/JKAlert",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "skyfox": "[email protected]"
    },
    "social_media_url": "http://www.skyfox.org",
    "platforms": {
        "ios": null
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/shaojiankui/JKAlert.git",
        "tag": "1.0.0"
    },
    "source_files": "JKAlert/JKAlert/JKAlert.{h,m}"
}

Pin It on Pinterest

Share This