TYAlertView 0.1.1

TYAlertView 0.1.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2016年10月

luckytianyiyan维护。



功能

  • UIAppearance 支持
  • 块语法

用法

简单

TYAlertView *alertView = [[TYAlertView alloc] initWithTitle:@"title" message:@"message"];
[alertView addAction:[TYAlertAction actionWithTitle:@"Ok"
                                              style:TYAlertActionStyleDefault
                                            handler:^(TYAlertAction * _Nonnull action) {
    NSLog(@"Ok button clicked");
}]];
[alertView show];

自定义 TYAlertView 主题

[TYAlertView appearance].titleColor = [UIColor redColor];
[TYAlertView appearance].messageColor = [UIColor redColor];
[TYAlertView appearance].separatorColor = [UIColor grayColor];
[TYAlertView appearance].shadowRadius = 4.0f;
[TYAlertView appearance].popupViewBackgroundColor = [UIColor blueColor];
// Button Title Color
[[TYAlertView appearance] setButtonTitleColor:[UIColor yellowColor]
                               forActionStyle:TYAlertActionStyleDefault
                                     forState:UIControlStateNormal];

示例

要运行示例项目,请克隆仓库,然后首先在 Example 目录中运行pod install

安装

TYAlertView 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile 中

pod "TYAlertView"

许可证

TYAlertViewMIT 许可证下提供。有关更多信息,请参阅 LICENSE 文件。