[翻译] SIAlertView

简介:

SIAlertView

https://github.com/Sumi-Interactive/SIAlertView

 

An UIAlertView replacement with block syntax and fancy transition styles. As seen in Grid Diary.

一个UIAlertView,使用了block的格式,以及很绚的交互动画,你可以看看 Grid Diary .

 

Features

  • use window to present 加载在window上
  • happy with rotation 你可以进行旋转
  • block syntax block格式
  • styled transitions 风格切换
  • queue support 队列支持
  • UIAppearance support 支持UIAppearance

 

Installation

 

Cocoapods(Recommended)

  1. Add pod 'SIAlertView' to your Podfile. 将SIAlertView添加到你的Podfile中
  2. Run pod install 执行install

 

Manual

  1. Add all files under SIAlertView/SIAlertView to your project 将SIAlertView文件夹中的所有文件添加到你的项目当中
  2. Add QuartzCore.framework to your project 添加QuartzCore.framework到你的项目中

 

Requirements

  • iOS 5.0 and greater iOS5.0+
  • ARC ARC

(If you are having any problems, just select your project -> Build Phases -> Compile Sources, double-click the SIAlertView and add -fobjc-arc)

如果你是MRC环境,选择project -> Build Phases -> Compile Sources,双击SIAlertView然后加上-fobjc-arc.

Examples

Code:

SIAlertView *alertView = [[SIAlertView alloc] initWithTitle:@"SIAlertView" andMessage:@"Sumi Interactive"]; [alertView addButtonWithTitle:@"Button1" type:SIAlertViewButtonTypeDefault handler:^(SIAlertView *alert) { NSLog(@"Button1 Clicked"); }]; [alertView addButtonWithTitle:@"Button2" type:SIAlertViewButtonTypeDestructive handler:^(SIAlertView *alert) { NSLog(@"Button2 Clicked"); }]; [alertView addButtonWithTitle:@"Button3" type:SIAlertViewButtonTypeCancel handler:^(SIAlertView *alert) { NSLog(@"Button3 Clicked"); }]; alertView.willShowHandler = ^(SIAlertView *alertView) { NSLog(@"%@, willShowHandler", alertView); }; alertView.didShowHandler = ^(SIAlertView *alertView) { NSLog(@"%@, didShowHandler", alertView); }; alertView.willDismissHandler = ^(SIAlertView *alertView) { NSLog(@"%@, willDismissHandler", alertView); }; alertView.didDismissHandler = ^(SIAlertView *alertView) { NSLog(@"%@, didDismissHandler", alertView); }; alertView.transitionStyle = SIAlertViewTransitionStyleBounce; [alertView show];

 

Credits

SIAlertView was created by Sumi Interactive in the development of Grid Diary.

 

License

SIAlertView is available under the MIT license. See the LICENSE file for more info.

 

目录
相关文章
|
存储 自然语言处理 前端开发
从零写一个Recoil(翻译)
Rewriting Recoil from scratchrecoil是facebook编写的一个库,它之所以诞生是因为人体工程学、context的性能问题和useState。这是一个非常聪明的库,几乎每个人都会找到它的用途——如果你想了解更多,请查看这段解释视频。刚开始我被图论和recoil惊到了,但渐渐的理解后,感觉也没那么特别了。也许我也可以实现一个类似的东西。我自己实现的版本和recoil
198 0
从零写一个Recoil(翻译)
|
安全 开发工具 C#
|
Java iOS开发 Spring
|
API Apache iOS开发