AAAlertController
是一个用于显示弹出式对话框的轻量级 UI 组件,它提供警报样式和操作表样式。它易于使用和集成到项目中。API 与 UIAlertController
相似,您可以在演示中看到其用法。
我们提供了示例项目。要运行它,在克隆仓库后,打开工作区文件。
AAAlertController
支持iOS 7.0+ 并需要 ARC 建造。
AAAlertController
通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod "AAAlertController"
并编辑 pod 文件,将 AAAlertController
安装到您的项目中,只需按以下命令执行即可
pod install
(请参阅我在示例项目中放置的用法)
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];
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 | |
---|---|---|
Alex Ao | [email protected] | @Alex Ao |
AAAlertController
在 MIT 许可协议下可用。有关更多信息,请参阅 LICENSE 文件。