AAAlertController 0.2.1

AAAlertController 0.2.1

测试已测试
语言语言 Obj-CObjective C
许可协议 MIT
发布最后发布2017年5月

aozhimin 维护。



logo

概述

AAAlertController 是一个用于显示弹出式对话框的轻量级 UI 组件,它提供警报样式和操作表样式。它易于使用和集成到项目中。API 与 UIAlertController 相似,您可以在演示中看到其用法。

示例项目

我们提供了示例项目。要运行它,在克隆仓库后,打开工作区文件。

Demo

要求

AAAlertController 支持iOS 7.0+ 并需要 ARC 建造。

安装

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

pod "AAAlertController"

并编辑 pod 文件,将 AAAlertController 安装到您的项目中,只需按以下命令执行即可

pod install

用法

(请参阅我在示例项目中放置的用法)

AAAlertStyleAlert

    AAPresentViewController *popupVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil]
                                        instantiateViewControllerWithIdentifier:@"AAAlertStyleViewController"];
        popupVC.view.frame = CGRectMake(0, 0, 300, 280);
    AAAlertController *alertController =
    [[AAAlertController alloc] initWithContentViewController:popupVC
                                           andPreferredStyle:AAAlertStyleAlert
                                          andAnimationOption:animationOption];
    [self presentViewController:alertController animated:YES completion:nil];

AAAlertStyleStyleActionSheet

    AAPresentViewController *popupVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil]
                                        instantiateViewControllerWithIdentifier:@"AAActionSheetStyleViewController"];
        popupVC.view.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 200);
    AAAlertController *alertController =
    [[AAAlertController alloc] initWithContentViewController:popupVC
                                           andPreferredStyle: AAAlertStyleStyleActionSheet
                                          andAnimationOption:animationOption];
    [self presentViewController:alertController animated:YES completion:nil];

作者

作者 Gmail Twitter
Alex Ao [email protected] @Alex Ao

许可协议

AAAlertController 在 MIT 许可协议下可用。有关更多信息,请参阅 LICENSE 文件。