Latest 0.0.4
Homepage https://github.com/Baichenghui/BCHAlertView
License MIT
Platforms ios 8.0, requires ARC
Authors

功能介绍

把UIAlertView,UIActionSheet,UIAlertController等控件的麻烦且没什么意义的代码封装起来;只需要一个api就能做出弹出框,点击弹出框的标记会以block形式传递出来.

用法

使用

pod ‘BCHAlertView’

1.UIView+BCHActionSheet

代码:

[UIView bch_showWithTitle:@"title" 
              cancelTitle:@"cancel" 
         destructiveTitle:@"destructiveTitle" 
              otherTitles:@[@"a",@"b",@"c",@"d",@"e"] 
                 callback:^(id sender, NSInteger buttonIndex) {
    NSLog(@"buttonIndex:%ld",buttonIndex);
}];

效果:

image

2.UIView+BCHAlert

代码:

[UIView bch_showWithTitle:@"提示" 
                  message:@"确定退出登录?" 
             buttonTitles:@[@"YES",@"NO"] 
                callback:^(id sender, NSUInteger buttonIndex) {
    NSLog(@"buttonIndex:%ld",buttonIndex);
}];

效果:

image

3.UIAlertController+BCHHelperKitUIKit

代码:

[UIAlertController bch_showWithTitle:@"提示"
                                         message:@"确定退出登录?"
                                    buttonTitles:@[@"YES",@"NO"]
                                  preferredStyle:UIAlertControllerStyleAlert
                                           block:^(UIAlertAction *action, NSUInteger buttonIndex) {
                NSLog(@"buttonIndex:%ld",buttonIndex);
            }];

效果:

image

代码:

[UIAlertController bch_showWithTitle:@"提示"
                                         message:@"确定退出登录?"
                                    buttonTitles:@[@"YES",@"NO"]
                                  preferredStyle:UIAlertControllerStyleActionSheet
                                           block:^(UIAlertAction *action, NSUInteger buttonIndex) {
                NSLog(@"buttonIndex:%ld",buttonIndex);
            }];

效果:

image

Latest podspec

{
    "name": "BCHAlertView",
    "version": "0.0.4",
    "summary": "u5bf9UIAlertView,UIActionSheet,UIAlertControlleru7b49u63a7u4ef6u5c01u88c5u7684u5f39u51fau6846..",
    "description": "u57fau4e8eUIAlertView,UIActionSheet,UIAlertControlleru7b49u63a7u4ef6u5b9eu73b0u7684u5f39u51fau6846,u7b80u5355u5b9eu7528.",
    "homepage": "https://github.com/Baichenghui/BCHAlertView",
    "license": "MIT",
    "authors": {
        "Baichenghui": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Baichenghui/BCHAlertView.git",
        "tag": "0.0.4"
    },
    "source_files": [
        "BCHAlertView",
        "BCHAlertView/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This