ActionSheet和AlertView的封装
来源:互联网 发布:搜图神器软件 编辑:程序博客网 时间:2024/05/18 17:56
ActionSheet的封装
github:https://github.com/LearnMoreAndBetter/RMActionSheet
# RMActionSheet
ActionSheet和AlertView的封装
提供了两种方式的封装
#pragma mark - 使用UIAlertController自定义的AlertView
/**
有“确定”按钮的AlertView
@param title 标题
@param message 内容
@param viewController 显示的控制器,可为nil
*/
+ (void)showOKAlertTitle:(NSString *)title
message:(NSString *)message
withController:(UIViewController *)viewController;
/**
有“确定”按钮的AlertView
@param title 标题
@param message 内容
@param viewController 显示的控制器,可为nil
@param doneBlock 确定block
*/
+ (void)showOKAlertTitle:(NSString *)title
message:(NSString *)message
withController:(UIViewController *)viewController
doneBlock:(void(^)())doneBlock;
/**
有“确定”和”取消“按钮的AlertView
@param title 标题
@param message 内容
@param viewController 显示的控制器,可为nil
@param doneBlock 确定block
*/
+ (void)showOKCancelAlertTitle:(NSString *)title
message:(NSString *)message
withController:(UIViewController *)viewController doneBlock:(void(^)())doneBlock;
/**
有多个按钮的AlertView
@param title 标题
@param message 内容
@param buttonTitles 按钮标题
@param viewController 显示的控制器,可为nil
@param selectBlock 选择block,返回标题及index
*/
+ (void)showAlertTitle:(NSString *)title
message:(NSString *)message
buttonTitles:(NSArray *)buttonTitles
withController:(UIViewController *)viewController
selectBlock:(void(^)(NSInteger selectIndex,NSString *title))selectBlock;
#pragma mark - HUD
/**
无按钮的AlertView(HUD),默认停留时间为1秒
@param text 内容
*/
+ (void)showMessage:(NSString *)text;
/**
无按钮的AlertView(HUD)
@param text 内容
@param delay 停留时间
*/
+ (void)showMessage:(NSString *)text
afterDelay:(NSTimeInterval)delay;
#pragma mark - 使用UIAlertController自定义的ActionSheet
/**
取消自定义的使用delegate的actionsheet
@param title 标题
@param message 内容
@param titles 除取消外的按钮
@param cancelButton 取消按钮标题,为空则没有取消按钮
@param viewController显示在控制器(可为空,如果为空则显示在默认控制器中)
@param delegate 协议
*/
+ (void)showSheetWithTitle:(NSString *)title
message:(NSString *)message
buttonTitles:(NSArray *)titles
cancelButton:(NSString *)cancelButton
inViewController:(UIViewController *)viewController
delegate:(id<RMActionSheetDelegate>)delegate;
/**
默认取消自定义的使用delegate的actionsheet
@param title 标题
@param message 内容
@param titles 除取消外的按钮
@param viewController显示在控制器(可为空,如果为空则显示在默认控制器中)
@param delegate 协议
*/
+ (void)showSheetWithTitle:(NSString *)title
message:(NSString *)message
buttonTitles:(NSArray *)titles
inViewController:(UIViewController *)viewController
delegate:(id<RMActionSheetDelegate>)delegate;
/**
取消自定义的使用block的actionsheet
@param title 标题
@param message 内容
@param titles 除取消外的按钮
@param cancelButton 取消按钮标题,为空则没有取消按钮
@param viewController显示在控制器(可为空,如果为空则显示在默认控制器中)
@param selectBlock 选择block,返回标题及index
@param cancelBlock 取消block
*/
+ (void)showSheetWithTitle:(NSString *)title
message:(NSString *)message
buttonTitles:(NSArray *)titles
cancelButton:(NSString *)cancelButton
inViewController:(UIViewController *)viewController
block:(void(^)(NSInteger selectIndex,NSString *title))selectBlock
cancelBlock:(void(^)())cancelBlock;
/**
默认取消使用block的actionsheet
@param title 标题
@param message 内容
@param titles 除取消外的按钮
@param viewController显示在控制器(可为空,如果为空则显示在默认控制器中)
@param selectBlock 选择block,返回标题及index
*/
+ (void)showSheetWithTitle:(NSString *)title
message:(NSString *)message
buttonTitles:(NSArray *)titles
inViewController:(UIViewController *)viewController
block:(void(^)(NSInteger selectIndex,NSString *title))selectBlock;
- ActionSheet和AlertView的封装
- Actionsheet和AlertView的使用
- IOS8 alertView 和 actionSheet 使用方法
- AlertView&ActionSheet
- 操作表ActionSheet和警报AlertView
- IOS8 AlertView和ActionSheet不兼容问题解决方案
- iOS8.0前后关于alertView和actionSheet
- alertView的简单封装
- iOS AlertView、ActionSheet
- IOS中的通知--操作表ActionSheet和警报AlertView
- [IOS Code]实现全局关闭所有键盘,actionSheet和alertView
- IOS中的通知--操作表ActionSheet和警报AlertView
- Iphone开发(六)IOS中的通知--操作表ActionSheet和警报AlertView
- Iphone开发(六)IOS中的通知--操作表ActionSheet和警报AlertView
- Iphone开发(六)IOS中的通知--操作表ActionSheet和警报AlertView
- Iphone开发(六)IOS中的通知--操作表ActionSheet和警报AlertView
- IOS SDK详解之UIAlertController(IOS8之后替代AlertView和ActionSheet)
- IOS SDK详解之UIAlertController(IOS8之后替代AlertView和ActionSheet)
- WebView滑动过程中去掉阴影
- android 框架
- ssh整合前后差异
- hbase配置、运行错误总结
- SVN问题解决办法
- ActionSheet和AlertView的封装
- ubuntu的新手知识
- zookeeper集群
- 如何提高Solidworks运行速度
- 杭州异地身份证办理条件以及材料
- x264参数介绍
- Windows+spyder中no module named 'tensorflow'解决方法
- java笔记--关于int和byte[]的转换
- 微信小程序开发之从相册获取图片 使用相机拍照 本地图片上传