一. 删除ViewController,Storyboard
1:直接删除Storyboard 和ViewController,不是删索引,是直接移除;
2:info中的plist文件删除 Main storyboard file base name
选项;
3:在appdelegaet
中重新创建window
,然后将自己的视图设为根视图然后让gaiwindow
现实出来即可。
二. 删除 SceneDelegate
1: 到info.plist
删除Application Scene Manifest
选项;
2: 删掉Scenedelegate.h和Scenedelegate.m这两个文件;
3: 删掉
- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions {}
- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {}
4: 在APPdelegate.h里面添加window属性
@property (strong, nonatomic) UIWindow * window;
5:在-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
里面添加
self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];
// ViewController 是你的 rootViewController
self.window.rootViewController = [[ViewController alloc]init];
[self.window makeKeyAndVisible];