i want to set style for status bar to:
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
if i'm doing it from AppDelegate directly - everything is ok, but via Typhoon - not.
1) That's working ok:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[self styleKit] apply];
[self.window makeKeyAndVisible];
return YES;
}
2) And that's not working:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
return YES;
}
-(void)initialize {
[[self styleKit] apply];
[self.window makeKeyAndVisible];
}
at second way i use typhoon like:
@implementation LAMainAssembly
-(AppDelegate *)appDelegate {
return [TyphoonDefinition withClass:[AppDelegate class] configuration:^(TyphoonDefinition *definition) {
[definition injectProperty:@selector(window) with:[self mainWindow]];
[definition injectProperty:@selector(styleKit)];
[definition performAfterInjections:@selector(initialize)];
}];
}
@end
in both cases i use same advanced version of styling, where there is a:
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
I think it's because Typhoon starts it's initialization before
didFinishLaunchingWithOptions
.I would recommend to avoid dependency on
Typhoon
initialization order and do any UI setup explicit afterdidFinishLaunchingWithOptions
method called (your first way)