Latest 1.0.1
Homepage https://github.com/luhuaren/HRAlertView
License TbagLicense
Platforms ios 8.0, requires ARC
Dependencies Masonry
Frameworks Foundation, UIKit
Authors

自定义Alert,支持使用代理和使用block两种方式处理点击事件。

使用方式:

1.需要设置代理

 HRAlertView *alert = [[HRAlertView alloc] initWithTitle:@"温馨提示"
                                                    message:@"您使用代理方式创建alert"
                                                   delegate:self
                                          cancelButtonTitle:@"取消"
                                          otherButtonTitles:@"确定", nil];                                       
[alert show];

2.block回调,不需要设置代理(alertview的代理是nsobject时代理方法不执行)

   HRAlertView *alert = [[HRAlertView alloc] initWithTitle:@"温馨提示" message:@"您使用block方式创建alert"];
    [alert addAction:[HRAlertAction actionWithTitle:@"取消" style:HHRAlertActionStyleCancel handler:nil]];
    [alert addAction:[HRAlertAction actionWithTitle:@"确定" style:HHRAlertActionStyleDefault handler:^{
        NSLog(@"您使用block方式创建alert");
    }]];
   [alert show];

Latest podspec

{
    "name": "HRAlertView",
    "version": "1.0.1",
    "summary": "A customer AlertView",
    "homepage": "https://github.com/luhuaren/HRAlertView",
    "license": {
        "type": "TbagLicense",
        "file": "LICENSE"
    },
    "authors": {
        "tbag": "[email protected]"
    },
    "source": {
        "git": "https://github.com/luhuaren/HRAlertView.git",
        "tag": "1.0.1"
    },
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "exclude_files": [
        "**/*.md",
        "**/LICENSE"
    ],
    "source_files": "HRAlertView/{HRAlertView.h,HRAlertView.m}",
    "requires_arc": true,
    "static_framework": true,
    "platforms": {
        "ios": "8.0"
    },
    "dependencies": {
        "Masonry": [
            "~> 1.1.0"
        ]
    }
}

Pin It on Pinterest

Share This