Question

I've just downloaded SVProgressHUD and incorporated it into my project as explained in the github documentation page, but even if I wrote out [SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeGradient];, it's not different from the default mask type, and when I tapped the screen while the cursor was revolving I got my app crashed - meaning I wasn't able to disable the user interaction feature since my app crashes before showing all of the table view cells there.

And note that clear or black mask type didn't work, either.

So how can I successfully disable the user interaction? And which file of the AppDelegate.m's applicationDidFinishWithLaunchingOptions: and FirstViewController.'s viewDidLoad: should I write the above code?

I use the latest version of the SVProgressHUD and use Xcode 5.1 and iOS 7.1. I also use ARC. Am I missing something?

[Update]

This was a bug issue and it has been resolved in the current version. Check it out on the Github page for the further info.

Was it helpful?

Solution 3

You're not missing anything. iOS 7 doesn't seem to respect the mask type, so user interaction is never disabled. I think it's a bug with SVProgressHUD rather than anything else. Bit frustrating really.

OTHER TIPS

This is very late to answer but just in case it can help someone because I was stuck with this issue for a while today. If you are using latest classes from github you won't face any issue but if you are using old classes then Replace below method from SVProgressHUD.m as below

+ (void)showWithStatus:(NSString *)status 
  {   
     [self setDefaultMaskType:SVProgressHUDMaskTypeGradient];
     [self showProgress:SVProgressHUDUndefinedProgress status:status];
  }

I am using SVProgressHUD with swift and iOS 10.2 . Just setting mask type

In AppDelegate

SVProgressHUD.setDefaultMaskType(.black) works.

and every time you write

SVProgressHUD.show()

it will show the mask and userInteraction is managed by it.

It can be done easily by doing some changes in SVProgressHUD class: just put
[self.window setUserInteractionEnabled:NO]; in the last of showprogress with status and put [self.window setUserInteractionEnabled:YES]; in dismiss method.

Objective C (AppDelegate.m)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    //add this line
    [SVProgressHUD setDefaultMaskType: SVProgressHUDMaskTypeBlack];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top