Closed leon0103 closed 8 years ago
Might really be handy to have a completion block in this case. Perhaps even replace the delegate with just blocks. An exposed completionBlock
property seems more useful to me than adding a completion block parameter to various calls.
however,i didn't find the method:@selector(hide:afterDelay: completion:^{}) in version 0.9.2 , but only the method:@selector( hide:afterDelay: ) ,can you help me?
use example:
-(void)showIcon:(NSString)imageName withTitle:(NSString)title description:(NSString)description { MBProgressHUD hud = [MBProgressHUD showHUDAddedTo:[self window] animated:YES]; hud.mode = MBProgressHUDModeCustomView; hud.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]] autorelease]; hud.labelText = title; hud.detailsLabelText = description; hud.margin = 20.f; hud.removeFromSuperViewOnHide = YES; [hud hide:YES afterDelay:3 completion:^{ [self releaseWindow]; }]; }