Xcode12删除默认main.storyboard改为纯代码模式

1. 删除main.storyboard和launchScreen.storyboard,右键delete-Move to Trash

2. 选中工程 - General - Deployment Info - Main Interface 设为空

App Icons and Launch Images - Launch Screen File 设为空

3. 删除SceneDelegate.h和SceneDelegate.m文件

4. 在AppDelegate.h 和AppDelegate.m文件中添加如下代码:

<pre>

//.h文件

@property (strong, nonatomic) UIWindow * window;

//.m文件插入到- (BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions 这个方法中

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

self.window.backgroundColor = [UIColor whiteColor];

self.window.rootViewController= tabbarController;

[self.window makeKeyAndVisible];

<pre>

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。