EasyAlert 是一个封装了 UIALertController 的便捷方法集合,用于减少需要的样板代码数量。
EasyAlert 建基于 UIAlertController 之上。它由一个提示视图(弹出消息)和一个动作表(从下往上弹出的菜单)组成。
#import <LEAAlertController.h>
....
LEAAlertController *alert = [LEAAlertController dismissibleAlertViewWithTitle:@"Info"
message:@"This is an Easy Alert example"
cancelButtonTitle:@"Got it!"];
[alert showInViewController:self];
#import <LEAActionSheet.h>
....
LEAActionSheet *actionSheet = [LEAActionSheet actionSheetWithTitle:@"Select an option:"];
[actionSheet addButtonWithTitle:@"Regular option"
andBlock:^(LEAActionSheet *actionSheet)
{
[self showDismissableAlert1:nil];
}];
[actionSheet showInViewController:self];
EasyAlert 附带了一个示例项目,其中提供了比上述更多的详细说明。
如果您遇到了 EasyAlert 的特定问题,或者有功能请求,或者想要分享评论,请在此处打开一个新问题。
我们鼓励提出 pull request,并非常感激!请尽可能保持与现有项目的一致性。如果您正在考虑对这个项目进行重大更改或添加,请提前通过打开新问题进行沟通。这可以让每个人都能与即将到来的更改保持一致,确保更改与项目的方针一致,并避免重复工作。
谢谢!