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文件中添加如下代码:

//.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];

你可能感兴趣的:(Xcode12删除默认main.storyboard改为纯代码模式)