I am using a MBProgressHUD
view to show loading state when i am downloading something from the Internet. When download is finished, i call the hide method to hide the view. I want to use a timer to judge whether download is finished by checking the view's hidden, namely, isHidden method. But when i set the view 's hide to YES, then check isHidden method, it returns NO. I don't know why the view works like this?
some snippets are as follows:
MBProgressHUD *HUD; // instance variable
In the download finished method:
[HUD hide:YES];
NSLog(@"HUD isHidden: %@",[HUD isHidden] ? @"YES" : @"NO");
When the method is called, the output is NO.
As per MBProgressHUD's implementation, they don't hide it using hidden property of UIView. They just sets alpha of MBProgressHUD to 0 so that it will not be visible.
I Found That:
In MBProgressHUD
isHidden
Method By default set NO so you can get all time to (When you check) NO
. You doesn't check in superviews.
For Check MBProgressHUD
Status hide/show.
Set [HUD setHidden:YES];
after [HUD hide:YES];
then after it will work fine .
NSLog(@"HUD isHidden: %@",[HUD isHidden] ? @"YES" : @"NO");
//Output in consol YES
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With