设置跟视图

    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

    [self.window makeKeyAndVisible];

    DYViewController *vc = [[DYViewController alloc] init];

    self.window.rootViewController = vc;

原文地址:https://www.cnblogs.com/liuting-1204/p/5911756.html