IYAlertView 0.3.0

IYAlertView 0.3.0

测试经过测试
语言语言 Obj-CObjective C
许可 MIT
发布最新版本2015年3月

Ivan Yorgov 维护。



  • 作者:
  • ivan yorgov

用法

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

需求

安装

示例用法

为弹窗中的按钮创建动作

IYAlertViewAction *alertActionDefault = [IYAlertViewAction alertActionWithType:kAlertTypeDefault
                                                                            title:@"Button title"
                                                                        andHandler:^(id alert) {
                                                                            //Do something after a button was pressed
                                                                        }];

显示默认动作的弹窗 - 标题为 "OK" 的按钮。

[IYAlertView presentAlertWithTitle:@"Title"
                               message:@"Message"
                            andActions:nil
                         inViewContext:self.view];

创建带有两个或更多按钮的弹窗

IYAlertViewAction *alertActionDefault = [IYAlertViewAction alertActionWithType:kAlertTypeDefault
                                                                            title:@"Button title"
                                                                        andHandler:^(id alert) {
                                                                            //Do something after a button was pressed
                                                                        }];
IYAlertViewAction *alertActionDestructive = [IYAlertViewAction alertActionWithType:kAlertTypeDestructive
                                                                            title:@"Cancel"
                                                                        andHandler:^(id alert) {
                                                                            //Do something after a button was pressed
                                                                        }];

[IYAlertView presentAlertWithTitle:@"Title"
                               message:@"Message"
                            andActions:@[alertActionDefault, alertActionDestructive]
                         inViewContext:self.view];

作者

ivan yorgov, [email protected]

许可

IYAlertView 适用于 MIT 许可。有关更多信息,请参阅 LICENSE 文件。