NZAlertView 0.0.13

NZAlertView 0.0.13

测试测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2014年12月

Bruno Tortato Furtado 维护。




  • 作者:
  • Bruno Tortato Furtado

简单直观的警告视图。类似于推送通知效果。此类使用 UIAlertView 的默认方法和协议。

NZAlertView


NZAlertView


Build Status Analytics

需求

NZAlertView 适用于 iOS 6.0+ 版本,并与 ARC 项目兼容。它依赖于以下苹果框架,这些框架应已包含在大多数 Xcode 模板中

  • Foundation.framework

要构建 NZAlertView,您需要 LLVM 3.0 或更高版本。

NZAlertView 使用 UIImage-Helpers 仓库操作图像。

将 NZAlertView 添加到您的项目中

源文件

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

  1. 下载最新的代码版本 master.zip 或将仓库作为 git 子模块添加到您的跟踪项目。
  2. 在 Xcode 中打开您的项目,然后将从 NZAlertView 文件夹中拖拽所有文件到您的项目上(使用“产品导航视图”)。如果从项目外部提取了代码归档,请确保在询问时选择复制项目。

用法

信息

  • 上工作
  • 带有或不带有状态栏都可以工作
  • 只能以 工作 orientation
  • 可以修改警告持续时间(默认: strong.5 秒)
  • 可以修改动画持续时间(默认: strong.0.6 秒)
  • 可以改变文字对齐方式(默认: strong.左对齐)
  • 一次只显示一个警告
  • 代理与 类似

样式

  • NZAlertStyleError
  • NZAlertStyleSuccess
  • NZAlertStyleInfo

展示

#import "NZAlertView.h"
...
{
    // There are several ways to init, just look at the class header
    NZAlertView *alert = [[NZAlertView alloc] initWithStyle:NZAlertStyleSuccess
                                                      title:@"Alert View"
                                                    message:@"This is an alert example."
                                                   delegate:nil];

    [alert setTextAlignment:NSTextAlignmentCenter];

    [alert show];      

    // or

    [alert showWithCompletion:^{
    NSLog(@"Alert with completion handler");
    }];                                            
}

代理

  • 所有代理都是可选的
#import "NZAlertViewDelegate.h"
...

- (void)willPresentNZAlertView:(NZAlertView *)alertView;
- (void)didPresentNZAlertView:(NZAlertView *)alertView;

- (void)NZAlertViewWillDismiss:(NZAlertView *)alertView;
- (void)NZAlertViewDidDismiss:(NZAlertView *)alertView;

设置器和获取器

@property (nonatomic, assign) id delegate;
@property (nonatomic, assign) NZAlertStyle alertViewStyle;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *message;
@property (nonatomic, readonly, getter = isVisible) BOOL visible;

@property (nonatomic, assign) NSString *fontName;
@property (nonatomic) NSTextAlignment textAlignment;
@property (nonatomic, assign) CGFloat alertDuration;
@property (nonatomic, assign) CGFloat animationDuration;
@property (nonatomic, assign) CGFloat screenBlurLevel;

图片和颜色

  • 如果您想进行修改,相应图像位于该捆绑包中: NZAlertView-Icons.budle
  • 要自定义颜色,扩展 NZAlertViewColor 类,并重写以下方法: errorColorinfoColorsuccessColor

许可证

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

变更日志

可以在 wiki 上找到每个 NZAlertView 版本的简要总结。

待办事项

方向

  • 支持横屏模式

设计

  • 通过按钮添加样式
  • 创建一个 NZAlertStyleCustom 风格