简体   繁体   English

如何将 swift 2.3 项目更新到最新的 swift 4

[英]How to update swift 2.3 project to latest swift 4

I am having too many cocoapods installed.我安装了太多 cocoapods。 It shows too many compile time errors.它显示了太多的编译时错误。 How to solve this?如何解决这个问题? I am new to swift so looking for help.我是 swift 的新手,所以正在寻求帮助。 Thanks谢谢

  • Choose auto upgrade after opening the project in Xcode 9.在 Xcode 9 中打开项目后选择自动升级。
  • In Podfile refer to the framework built in swift 4. Add below script in your Podfile and do a pod install, which will set the swift version of all pod targets to 4.在 Podfile 中引用 swift 4 中内置的框架。 在 Podfile 中添加以下脚本并执行 pod install,这会将所有 pod 目标的 swift 版本设置为 4。

    post_install do |installer| post_install 做 |安装程序|

     installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '4' end end

    end结尾

Hope this helps in proceeding in upgrading the application to swift4希望这有助于将应用程序升级到 swift4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM