Skip to content

Instantly share code, notes, and snippets.

@inailuy
Created March 17, 2013 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inailuy/5182946 to your computer and use it in GitHub Desktop.
Save inailuy/5182946 to your computer and use it in GitHub Desktop.
properly show SVProgressHUD when resigning keyboard
// resign keyboard
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
[SVProgressHUD showWithStatus:@"Searching..." maskType:SVProgressHUDMaskTypeBlack];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//do search
dispatch_async(dispatch_get_main_queue(), ^{
//search finished - do smth with search results and hide hud
[SVProgressHUD dismiss];
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment