iOS-一个对UIAlertController的封装类分享
2016-03-31 13:34
513 查看
一个对于UIAlertController的封装类,支持自定义 .
在项目中会用到提醒框,每次都是重复的代码,尤其是简单的提醒,更是重复工作.做了一个对UIAlertController的封装类,如果简单的提醒,仅仅在初始化show即可,iOS8中主推UIAlartController替代UIAlertView,更灵活.
在封装类中初始化:
使用:
可以添加自定义UIAlertAction对象达到想要的效果.
源码地址:https://github.com/qxuewei/XWAlertController
在项目中会用到提醒框,每次都是重复的代码,尤其是简单的提醒,更是重复工作.做了一个对UIAlertController的封装类,如果简单的提醒,仅仅在初始化show即可,iOS8中主推UIAlartController替代UIAlertView,更灵活.
在封装类中初始化:
XWAlertController *defaultAlertVC = [XWAlertController XWAlertDefaultMessage:@"好的" alertControllerWithTitle:nil message:@"您正在展示默认提醒样式" preferredStyle:UIAlertControllerStyleAlert];
使用:
[defaultAlertVC show];
可以添加自定义UIAlertAction对象达到想要的效果.
源码地址:https://github.com/qxuewei/XWAlertController
相关文章推荐
- iOS: setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key name.
- iOS UITableViewController出现crash
- 从response.header中提取cookie,在request里添加cookie
- 从response.header中提取cookie,在request里添加cookie
- UItableView的两个重用机制区别
- UI练习
- requests用法
- JAVA GUI之CardLayout
- 客户端窗口UI管理
- request.getInputStream()只能获取一次的问题
- UICollectionViewLayout
- 270. Closest Binary Search Tree Value
- HDU 1159 Common Subsequence (dp)
- FreeMarker boolean Issue
- 302. Smallest Rectangle Enclosing Black Pixels My Submissions QuestionEditorial Solution
- Issues about gradle version and Android Plugin Version
- Mybatis报TypeException:JDBC requires that the JdbcType must be specified for all nullable parameters.
- DruidDataSource配置
- 定义一个Map对象,遍历并打印出各元素的key和value
- OnClick与android:focusableInTouchMode="true"