MLVAlertKit 1.1.0

MLVAlertKit 1.1.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2016年8月

melvyndev 维护。



MLVAlertKit 是一个可定制的 alert 和 action sheet UI 框架,类似于 UIAlertController,但我们对出现和消失动画进行了改动以提高用户体验,同时您也可以自定义文本属性。

MLVAlertKit

要求

MLVAlertKit 版本 最低 iOS 目标 描述
1.0.0 iOS 8
1.1.0 iOS 7 添加 UITextField 支持

安装

MLVAlertKit 可以使用 CocoaPods、Cathage 添加到项目中,也可以使用项目包含的源文件。

源文件

或者您可以将源文件直接添加到项目中。

  1. 下载最新代码版本 latest code version 或将仓库作为 git 子模块添加到您跟踪的 git 项目中。
  2. 在 Xcode 中打开您的项目,然后将 MLVAlertKit.hMLVAlertController.hMLVAlertController.mMLVAlertAnimator.hMLVAlertAnimator.m 拖放到您的项目中(当在项目外部提取代码存档时请确保选择“复制项目”)。
  3. 使用 #import "MLVAlertKit.h" 将 MLVAlertKit 包含在您需要的位置。

使用说明

您可以从任何 UIViewController(如 UIAlertController)中呈现 alert。

MLVAlertController *alert = [MLVAlertController alertControllerWithTitle:@"Remind !!" message:@"Support is on Github" preferredStyle:MLVAlertControllerStyleAlert];
MLVAlertAction *cancel = [MLVAlertAction actionWithTitle:@"Cancel" style:MLVAlertActionStyleCancel handler:^(MLVAlertAction * _Nonnull action) {

}];
[alert addAction:cancel];
[self presentViewController:alert animated:YES completion:NULL];

使用引用添加 UITextFields:

- (void)addTextFieldWithConfigurationHandler:(void (^ __nullable)(UITextField *textField))configurationHandler;

如果您需要配置属性,可以使用 MLVAlertController 引用这样操作:

+ (instancetype)alertControllerWithAttributedTitle:(nullable NSAttributedString *)title message:(nullable NSAttributedString *)message preferredStyle:(MLVAlertControllerStyle)preferredStyle;
+ (instancetype)actionWithAttributedTitle:(NSAttributedString *)title style:(MLVAlertActionStyle)style handler:(void (^ __nullable)(MLVAlertAction *action))handler;

更多示例,请下载 MLVAlertKit 并尝试 iPhone 示例应用

许可证

MLVAlertKit 基于 MIT 许可证发布。有关详情,请参阅 LICENSE。