-
Notifications
You must be signed in to change notification settings - Fork 324
Example Code
myell0w edited this page Feb 23, 2011
·
2 revisions
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
[MTStatusBarOverlay sharedInstance].animation = MTStatusBarOverlayAnimationFallDown;
[MTStatusBarOverlay sharedInstance].historyEnabled = YES;
[[MTStatusBarOverlay sharedInstance] postMessage:@"I should fork it..."];
[self performSelector:@selector(changeTextAnimated:) withObject:@"... and add even more..." afterDelay:4];
[self performSelector:@selector(changeText:) withObject:@"... awesome features to it..." afterDelay:6];
[self performSelector:@selector(changeTextAnimated:) withObject:@"...as well as tell my friends..." afterDelay:8];
[self performSelector:@selector(changeTextAnimated:) withObject:@"...and spread the world!" afterDelay:9];
[self performSelector:@selector(changeTextAnimated:) withObject:@"MTStatusBarOverlay rocks!" afterDelay:10];
}
return self;
}
- (void)changeText:(NSString *)text {
[[MTStatusBarOverlay sharedInstance] postMessage:text animated:NO];
}
- (void)changeTextAnimated:(NSString *)text {
[[MTStatusBarOverlay sharedInstance] postMessage:text animated:YES];
}