1. AppDelegate.h 加上 window 属性
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (nonatomic, strong) UIWindow *window;
@end
2. 删除 AppDelegate.m 中的 UISceneSession lifecycle
#pragma mark - UISceneSession lifecycle
- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
}
- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
3. 删除 info.plist 的 Application Scene Manifest
4. 设置项目前缀
5. 设置Deployment Info
6. 新建 PCH 文件,#import 常用的类和自定义分类
7. 新建 .h 文件,设置用于适配屏幕的宏和自定义宏
新建一个类文件,继承于NSObject,新建后去掉.m文件即可
8. 新建 Supporting Files 文件夹,将 AppDelegate 和新建好的文件拖进去
9. 设置 PCH 文件的位置
10. 设置 info.plist 文件的位置
11.根据你当前项目的布局新建加了前缀的 UITabbarController 或 UIViewController 作为主控制器
最后
如果我的文章对你有帮助,麻烦你点一下左边的赞。如果你有好的想法或建议都可以给我留言,我会及时回复,希望可以和你们一起进步!