Skip to content

Instantly share code, notes, and snippets.

@b00gizm
Created October 6, 2009 11:56
Show Gist options
  • Save b00gizm/202946 to your computer and use it in GitHub Desktop.
Save b00gizm/202946 to your computer and use it in GitHub Desktop.
// Create your SFHFHudView object (maybe inside of viewDidLoad:)
HUD = [[SFHFHUDView alloc] initWithFrame:[[UIApplication sharedApplication].keyWindow bounds]];
// Show your HUD
// remember: SFHFHudView is subclass of UIView, not UIView
[HUD setStatusText:@"Doing stuff ..."];
[HUD setShowsStatusLabel:YES];
[HUD startActivityIndicator];
[HUD makeKeyAndVisible];
// Hide your HUD
[HUD stopActivityIndicator];
[HUD resignKeyWindow];
[HUD setHidden:YES];
// Don't forget to make your "normal" window the key window again.
// Otherwise you'll have trouble showing the HUD again
[[[[UIApplication sharedApplication] delegate] window] makeKeyWindow];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment