iOS13以后新项目如何去除StoryBoard,从代码启动

163 阅读1分钟

1.删除Main.storyboard 2.TARGETS项目设置中Info里,删除Main storyboard file base name整个条目

当前编译可以成功,但是运行会出现“Could not find a storyboard named 'Main' in bundle NSBundle”

3.同样是Info.plist中,Application Scene Manifest->Scene Configuration->Item 0->StoryBoard Name,这一条目直接删除

现在可以运行成功了

其他问题:现在SceneDelegate接替了APPDelegate部分功能,自定义rootViewController需要在SceneDelegate中实现

image.png