前言
整理下😄
内容
- 删除
SceneDelegate
文件,删除AppDelegate
中的多余代码 - 删除
Main.storyboard
-
修改info.plist为如图
image.png
- 修改
General
为如图
image.png
- 创建
pch
文件,并将它的路径添加到配置中(其中/dewu/core
是你的路径名)
$(SRCROOT)/dewu/core/IMEPrefixHeader.pch
![](https://img.haomeiwen.com/i436419/4604465b33b788ba.png)
- 在AppDelegate中写下代码测试是否成功
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (nonatomic,strong) UIWindow *window;
@end
#import "AppDelegate.h"
#import "ViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];
ViewController *vc = [[ViewController alloc]init];
vc.view.backgroundColor = [UIColor redColor];
self.window.rootViewController = vc;
[self.window makeKeyAndVisible];
return YES;
}
-
工程目录展示
image.png
使用cocopods
具体方法看我以前的文章或者百度
# Uncomment the next line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
target 'dewu' do
use_frameworks!
pod 'SVProgressHUD' #指示器
end
![](https://img.haomeiwen.com/i436419/e492675e0552d258.png)
网友评论