MBProgressHUD+FastCall

时间:2023-10-29 17:41:32

MBProgressHUD+FastCall

  

+ (void)showHudTipStr:(NSString *)tipStr;

+ (void)showHudTipStr:(NSString *)tipStr{
if (tipStr && tipStr.length > ) {
MBProgressHUD *hud = [self showHUDAddedTo:[UIApplication sharedApplication].keyWindow animated:YES];
hud.mode = MBProgressHUDModeText;
hud.detailsLabelFont = [UIFont boldSystemFontOfSize:15.0];
hud.detailsLabelText = tipStr;
hud.margin = .f;
hud.removeFromSuperViewOnHide = YES;
[hud hide:YES afterDelay:1.0];
}
}

调用

[self.user updateInBackgroundWithResultBlock:^(BOOL isSuccessful, NSError *error) {

NSString *tip = isSuccessful?@"设置成功":error.userInfo[@"error"];

 [MBProgressHUD showHudTipStr:tip];

 }];