Skip to content

Instantly share code, notes, and snippets.

@yuanmai
Created May 7, 2012 06:04
Show Gist options
  • Save yuanmai/2626193 to your computer and use it in GitHub Desktop.
Save yuanmai/2626193 to your computer and use it in GitHub Desktop.
[MBProgressHUD showHUDAddedTo:[self.view.window.subviews objectAtIndex:0] animated:YES];
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
// Do something...
dispatch_async(dispatch_get_main_queue(), ^{
[MBProgressHUD hideHUDForView:[self.view.window.subviews objectAtIndex:0] animated:YES];
});
});
[MBProgressHUD HUDForView: [UIApplication sharedApplication].keyWindow]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment