一、创建一个Swift应用
然后用Cocopods引入一些三方库,podfile文件如下:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
use_frameworks!
inhibit_all_warnings!
target 'WRClearWaterApp' do
pod 'SnapKitExtend' #UI布局 masrony
pod 'Then'
pod 'Moya' #网络请求。AF
pod 'HandyJSON' #数据转模型 -> mjexteion
pod 'Kingfisher' #图片缓存 ->SDweb
pod 'Reusable' #列表冲用
pod 'LLCycleScrollView'#轮播图
pod 'MJRefresh' #刷新
pod 'MBProgressHUD' #弹窗
pod 'HMSegmentedControl' #分段控制器
pod 'IQKeyboardManagerSwift' #键盘
pod 'EmptyDataSet-Swift' #空数据
pod 'UINavigation-SXFixSpace' #导航栏按钮位置
end
# Showing Recent Errors Only
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
end
end
pod install后打开项目如果能正常运行那就集成三方库成功。
二、删除scneDelegate
1.点击main.stroryboard ,将is initila view Controller取消勾选
2.将SceneDelegate、ViewController、Main.stroryboard、LauchScreen.stroryboard删除
(注意:LauchScreen.stroryboard删除后如果在info.plist设置启动图会被放大,后期我又用了LauchScreen.stroryboard方法)
3.在AppDelegate中删除Scene相关代码
4.删除info里面的Application Scene Mainifest和Main Storyboard file base name
5.设置自己的根控制器在AppDelegate设置