UIKit之UIWindow

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // 1.初始化window界面
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    // 2. 设置window背景色
    self.window.backgroundColor = [UIColor whiteColor];
    // 3. 应用window到程序
    [self.window makeKeyAndVisible];
    // 4.设置窗口的主控制器
    self.window.rootViewController = [UIViewController new];

    return YES;
}

你可能感兴趣的:(UIKit之UIWindow)