PRAlertController 0.1.5

PRAlertController 0.1.5

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最新发布2015年6月

Elethom Hunter 维护。



通用

具有与 iOS 8 SDK 相同的 API(不支持文本字段),兼容 iOS 7。

安装

用法

它与 iOS 8 SDK 具有完全相同的 API(除了文本字段部分)。此外,使用 -show-dismiss 方法可以在您想要的地方弹出警报,无需担心如何获取当前视图控制器的指针。

示例

PRAlertController *alertController = [PRAlertController alertControllerWithTitle:@"Title"
                                                                         message:@"This is the message."
                                                                  preferredStyle:PRAlertControllerStyleAlert];
PRAlertAction *firstAction = [PRAlertAction actionWithTitle:@"First"
                                                      style:PRAlertActionStyleDefault
                                                    handler:^(PRAlertAction *action) {
                                                        [self doFirstAction];
                                                    }];
PRAlertAction *secondAction = [PRAlertAction actionWithTitle:@"Second"
                                                       style:PRAlertActionStyleDefault
                                                     handler:^(PRAlertAction *action) {
                                                         [self doSecondAction];
                                                     }];
PRAlertAction *destructiveAction = [PRAlertAction actionWithTitle:@"Destructive"
                                                            style:PRAlertActionStyleDestructive
                                                          handler:^(PRAlertAction *action) {
                                                              [self doDestructiveAction];
                                                          }];
PRAlertAction *cancelAction = [PRAlertAction actionWithTitle:@"Cancel"
                                                       style:PRAlertActionStyleCancel
                                                     handler:^(PRAlertAction *action) {
                                                         [self doCancelAction];
                                                     }];
[alertController addAction:firstAction];
[alertController addAction:secondAction];
[alertController addAction:destructiveAction];
[alertController addAction:cancelAction];
[alertController show];

看起来很简单。

许可证

此代码根据 MIT 许可协议 的条款和条件进行分发。

捐赠

您可以通过以下方式支持我

:-)

联系方式