显示UIAlertView和UIActionSheet的开源框架FYAlertManage

use to display "UIAlertView" and "UIActionSheet” , that support iOS8 and iOS8 before

When you use "UIAlertView" and "UIActionSheet” in iOS8,screen direction changed lead to view show abnormal.

As you can see

UIActionSheet

UIAlertView
In iOS8 after,system provide a new class UIAlertController replace UIAlertView and UIActionSheet.
If you need support iOS8 before,you can use FYAlertManage to support iOS8 and iOS8 before.

It provides:

  • ARC and no ARC support
  • Arm64 support
  • Display a UIAlertView and UIActionSheet in iOS8 and iOS8 before support
How To Use

Display a UIAlertView

<pre><code>
FYAlertManage *alertMan = [[FYAlertManage alloc] initWithTitle:@"提示" message:@"内容" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"第一个按钮",@"第一个按钮",nil];
[alertMan show];
#if ! __has_feature(objc_arc) [alertMan release]; #endif
</pre></code>

Display a UIAlertView with Login And Password Input

<pre><code>
FYAlertManage *alertMan = [[FYAlertManage alloc] initWithTitle:@"提示" message:@"请输入内容和密码" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定",nil];
alertMan.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;
alertMan.tag = 333;
[alertMan show];
#if ! __has_feature(objc_arc) [alertMan release];#endif
</pre></code>

Display a UIActionSheet

<pre><code>
FYAlertManage *alertMan = [[FYAlertManage alloc] initWithTitle:@"提示" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"特别提醒按钮" otherButtonTitles:@"第一个按钮",nil];
[alertMan showInView:self.view];
#if ! __has_feature(objc_arc) [alertMan release];#endif
</pre></code>

下载地址:https://github.com/wangyangcc/FYAlertManage

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容