123456789101112131415161718192021222324252627282930313233343536 |
- //
- // NSObject+Hint.m
- // HCQuanfangtong
- //
- // Created by qft_Ios_03 on 2018/11/30.
- // Copyright © 2018 qft_Ios_03. All rights reserved.
- //
- #import "NSObject+Hint.h"
- #import "MBProgressHUD.h"
- @implementation NSObject (Hint)
- - (void)xb_showHint:(NSString *)message
- afterDismiss:(float)after
- withCoding:(void (^)(void))CodeBlock{
- UIView *view = [[UIApplication sharedApplication].delegate window];
- MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
- hud.mode = MBProgressHUDModeText;
- hud.bezelView.color = [UIColor blackColor];
- hud.label.font = [UIFont systemFontOfSize:14];
- hud.label.textColor = [UIColor whiteColor];
- hud.label.text = message;
- hud.label.numberOfLines = 0;
- hud.margin = 10.f;
- hud.removeFromSuperViewOnHide = YES;
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(after * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [hud hideAnimated:YES];
- CodeBlock();
- });
- }
- @end
|