Latest 1.0.0
Homepage https://github.com/DandreYang/YFMessage
License MIT
Platforms ios 8.0
Dependencies MBProgressHUD
Authors

对UIAlertController和MBProgressHUD的二次封装,实现一句代码快速调用


@interface YFMessage (AlertView)

/**
 alert提示框待UIAlertController返回值

 @param message 提示内容
 @param title 提示标题
 @param style alert类型
 @param actions UIAlertAction对象的集合
 @return 返回UIAlertController对象
 */
+ (UIAlertController *_Nonnull)alert:(NSString *_Nullable)message
                               title:(NSString *_Nullable)title
                               style:(UIAlertControllerStyle)style
                             actions:(NSArray <UIAlertAction *> *_Nullable)actions;

/**
 alert提示框待UIAlertController返回值

 @param message 提示内容
 @param title 提示标题
 @param style alert类型
 @param cancelActionTitle 取消按钮标题
 @param actionTitles 其他按钮标题的集合
 @param callback 点击按钮时的回调
 @return 返回UIAlertController对象
 */
+ (UIAlertController *_Nonnull)alert:(NSString *_Nullable)message
                               title:(NSString *_Nullable)title
                               style:(UIAlertControllerStyle)style
                   cancelActionTitle:(NSString *_Nullable)cancelActionTitle
                   otherActionTitles:(NSArray<NSString *> *_Nullable)actionTitles
                         clickedBack:(void(^_Nullable)(NSString *_Nonnull actionTitle, NSInteger actionIndex))callback;

/**
 alert提示框

 @param message 提示的内容,可以是对象,如数组
 */
+ (void)alert:(id _Nullable)message;

/**
 alert提示框

 @param message 提示的内容,可以是对象,如数组
 @param title 提示的标题
 */
+ (void)alert:(NSString * _Nullable)message title:(NSString *_Nullable)title;

/**
 alert提示框

 @param message 提示的内容
 @param cancelTitle 取消按钮标题
 @param conformTitle 确认按钮标题
 @param callback 点击按钮后的回调
 */
+ (void)alert:(NSString *_Nullable)message
  cancelTitle:(NSString *_Nullable)cancelTitle
 conformTitle:(NSString *_Nullable)conformTitle
  clickedBack:(void(^_Nullable)(NSString *_Nonnull actionTitle, NSInteger actionIndex))callback;

/**
 alert提示框

 @param message 提示的内容
 @param title 提示的标题
 @param cancelTitle 取消按钮标题
 @param conformTitle 确认按钮标题
 @param callback 点击按钮后的回调
 */
+ (void)alert:(NSString *_Nullable)message
        title:(NSString *_Nullable)title
  cancelTitle:(NSString *_Nullable)cancelTitle
 conformTitle:(NSString *_Nullable)conformTitle
  clickedBack:(void(^_Nullable)(NSString *_Nonnull actionTitle, NSInteger actionIndex))callback;

/**
 带一个输入框的alert提示框

 @param title 提示标题
 @param message 提示内容
 @param cancelTitle 取消按钮标题
 @param conformTitle 确认按钮文本
 @param textFieldConfigHandler 输入框的配置闭包
 @param callback 点击按钮时的回调
 */
+ (void)alertEditViewWithTitle:(NSString *_Nullable)title
                       message:(NSString *_Nullable)message
                   cancelTitle:(NSString *_Nullable)cancelTitle
                  conformTitle:(NSString *_Nullable)conformTitle
        textFieldConfigHandler:(void(^_Nullable)(UITextField * _Nonnull textField))textFieldConfigHandler
                   clickedBack:(void(^_Nullable)(NSString * _Nonnull actionTitle, NSInteger actionIndex))callback;

/**
 支持自定义内容对齐方式的alert提示框

 @param message 提示内容
 @param title 提示标题
 @param cancelTitle 取消按钮标题
 @param conformTitle 确认按钮标题
 @param textAlign 内容对齐方式
 @param callback 点击按钮时的回调
 */
+ (void)alert:(id _Nullable)message
        title:(NSString *_Nullable)title
  cancelTitle:(NSString *_Nullable)cancelTitle
 conformTitle:(NSString *_Nullable)conformTitle
    textAlign:(NSTextAlignment)textAlign
  clickedBack:(void(^_Nullable)(NSString * _Nonnull actionTitle, NSInteger actionIndex))callback;

@end

@interface YFMessage (MBProgressHUD)

/**
 *  可以自动隐藏的提示
 *
 *  @param message 提示的内容
 *  @param view    提示视图要显示在的视图
 *  @param flag    是否自动隐藏
 */
+ (void)show:(id _Nullable )message onView:(UIView *_Nonnull)view autoHidden:(BOOL)flag;

/**
 *  显示HUD提示
 *
 *  @param message        提示的文字
 *  @param image          提示的image
 *  @param viewController delegate
 *  @param autoHidden     是否自动隐藏
 */
+ (void)show:(id _Nullable )message
       image:(UIImage *_Nullable)image
    delegate:(__kindof UIViewController *_Nonnull)viewController
  autoHidden:(BOOL)autoHidden;

/**
 *  创建并显示小菊花
 */
+ (void)showActiveViewOnView:(UIView *_Nonnull)view;
+ (void)showActiveViewWithTipString:(NSString *_Nullable)tipString
                             onView:(UIView *_Nonnull)view;
/**
 *  小菊花-无超时限制
 */
+ (void)showActiveViewMessage:(NSString *_Nonnull)tipString
                       onView:(UIView *_Nonnull)view;
/**
 *  隐藏小菊花
 */
+ (void)hideActiveView;

@end

Latest podspec

{
    "name": "YFMessage",
    "version": "1.0.0",
    "summary": "u5bf9UIAlertControlleru548cMBProgressHUDu7684u4e8cu6b21u5c01u88c5uff0cu5b9eu73b0u4e00u53e5u4ee3u7801u5febu901fu8c03u7528",
    "homepage": "https://github.com/DandreYang/YFMessage",
    "license": "MIT",
    "authors": {
        "u2018Dandreu2019": "[email protected]"
    },
    "social_media_url": "https://yangfeng.pw",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/DandreYang/YFMessage.git",
        "tag": "1.0.0"
    },
    "source_files": "YFMessage/**/*.{h,m}",
    "public_header_files": "YFMessage/**/*.h",
    "dependencies": {
        "MBProgressHUD": [
            "~> 0.9"
        ]
    }
}

Pin It on Pinterest

Share This