简单直观的提醒视图。类似于推送通知效果。此类使用UIAlertView默认方法和协议。
NZAlertView在iOS 6.0及以上版本上运行,支持ARC项目。它依赖于以下Apple框架,这些框架大多数情况下已经包含在Xcode模板中:
为了构建NZAlertView,您需要 LLVM 3.0或更高版本。
NZAlertView使用UIImage-Helpers项目来操作图像。
或者您可以直接将源文件添加到项目中。
NZAlertView
文件夹中(使用“Product Navigator view”)。如果您的代码存档提取在项目外部,确保选择复制项目时选取。UIAlertView
类似#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
类并重写方法: errorColor
、infoColor
和 successColor
。此代码根据 MIT 许可证的条款和条件分发。
每个 NZAlertView 版本的简要总结可以在 wiki 上找到。
NZAlertStyleCustom
样式