We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Noodled around a bit and found an easy way to use this great control as a custom HUD / spinner replacement:
In your class.h file interface:
SCLAlertView *hud; NSString *hudTitle; NSString *hudText;
In your class.m file provide these methods:
(void)startHud {
[self.view endEditing:YES]; //make sure keyboard is down
hud = [[SCLAlertView alloc] init]; [hud setShowAnimationType:SlideInToCenter]; hud.backgroundType = Blur; hud.customViewColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.7f]; //set custom color [hud setHideAnimationType:SlideOutFromCenter]; [hud showWaiting:self title:hudTitle subTitle:hudText closeButtonTitle:nil duration:0]; }
-(void)stopHud { [hud setHideAnimationType:SlideOutToCenter]; hudText = @""; hudText = @""; [hud hideView]; }
Now wherever you want to invoke the spinner simply:
hudTitle = NSLocalizedString(@"Processing Authorization", nil); hudText = NSLocalizedString(@"Communicating with host...", nil); [self startHud];
Wherever you want to hide the spinner:
[self stopHud];
Taking this a step further combining with SCAlerts:
[alert addButton:NSLocalizedString(@"Authorization", nil) actionBlock:^{ hudTitle = NSLocalizedString(@"Processing Authorization", nil); hudText = NSLocalizedString(@"Communicating with host...", nil); [self saveObject]; //invoke some method return; }]; [alert addButton:NSLocalizedString(@"Update Application", nil) actionBlock:^{ hudTitle = NSLocalizedString(@"Update Application", nil); hudText = NSLocalizedString(@"Communicating with host...", nil); [self updateObject]; //invoke some other method return; }];
in your method (saveObject);
-(void)saveObject { [self startHud]; // do something [self stopHud]; }
The text was updated successfully, but these errors were encountered:
Nice
Sorry, something went wrong.
No branches or pull requests
Noodled around a bit and found an easy way to use this great control as a custom HUD / spinner replacement:
In your class.h file interface:
In your class.m file provide these methods:
(void)startHud {
[self.view endEditing:YES]; //make sure keyboard is down
hud = [[SCLAlertView alloc] init];
[hud setShowAnimationType:SlideInToCenter];
hud.backgroundType = Blur;
hud.customViewColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.7f]; //set custom color
[hud setHideAnimationType:SlideOutFromCenter];
[hud showWaiting:self title:hudTitle
subTitle:hudText
closeButtonTitle:nil duration:0];
}
-(void)stopHud {
[hud setHideAnimationType:SlideOutToCenter];
hudText = @"";
hudText = @"";
[hud hideView];
}
Now wherever you want to invoke the spinner simply:
Wherever you want to hide the spinner:
Taking this a step further combining with SCAlerts:
in your method (saveObject);
-(void)saveObject {
[self startHud];
// do something
[self stopHud];
}
The text was updated successfully, but these errors were encountered: