// // AppDelegate+Extesion.m // HiBit // // Created by HI_LOSER on 2024/6/7. // #import "AppDelegate+Extesion.h" #import "HBTabBarController.h" #import "HBFirstStartController.h" @implementation AppDelegate (Extesion) - (void)loadWindow { [HBNetWorkingUtility commom_deviceRegisterWithComplateBlock:nil]; BOOL notFirstStart = [NSUserDefaults boolForKey:HBNotFirstStartKey]; self.window = [[UIWindow alloc]initWithFrame:UIScreen.bounds]; self.window.backgroundColor = UIColor.redColor; self.window.rootViewController = notFirstStart ? [HBTabBarController new] : [HBFirstStartController navigationController]; [self.window makeKeyAndVisible]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadRootController) name:HBMultiLanguageChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadRootController) name:HBFirstStartNotification object:nil]; } - (void)reloadRootController { BOOL notFirstStart = [NSUserDefaults boolForKey:HBNotFirstStartKey]; self.window.rootViewController = notFirstStart ? [HBTabBarController new] : [HBFirstStartController navigationController]; } @end