iOS自定义初始化Window

新建工程后删除viewController.h和viewController.m main.storyboard

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    //创建窗口

    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];//初始化Window

    UITabBarController * tabBarVc = [[UITabBarController alloc]init];

    self.window.rootViewController = tabBarVc;//设置根视图控制器

    //显示窗口

    [self.window makeKeyAndVisible];

    return YES;

}

原文地址:https://www.cnblogs.com/PJXWang/p/5540700.html