Closed magic3584 closed 5 years ago
I wanna make a toast with a macro like this:
#define showToast(msg) [MyHudView showMessage:msg forView:self.view animation:YES]; + (void)showMessage:(NSString *)message forView:(UIView *)view animation:(BOOL)animation { MBProgressHUD *hud = [[MBProgressHUD alloc]init]; [view addSubview:hud]; // hud.label.text = message; hud.label.numberOfLines = 0; hud.bezelView.backgroundColor = [UIColor blackColor]; [hud setMode:MBProgressHUDModeText]; hud.bezelView.layer.cornerRadius = 30.0; hud.label.textColor = [UIColor whiteColor]; // [hud showAnimated:animation]; [hud hideAnimated:animation afterDelay:2.0]; }
I use it in UIViewController like this:
showToast(@"some message");
It is visually removed but not actually while using Xcode debug hierarchy :
Thanks for your help
You need to manually remove it or set https://github.com/jdg/MBProgressHUD/blob/202d8895c6eb10ead2e4b3c5837a68c95693d51f/MBProgressHUD.h#L208
@matej Appreciate for your instruction, thx~
I wanna make a toast with a macro like this:
I use it in UIViewController like this:
It is visually removed but not actually while using Xcode debug hierarchy :
Thanks for your help