Upgrade Xcode 7.3.1 Project to Xcode 8.0

2019-10-09 04:09发布

I want to upgrade my Xcode 7.3.1 Project to Xcode 8. My project was written in swift 2.2 in Xcode 7 but now I want to upgrade to Xcode 8 with swift 3.0. My project contains some pod-files library while upgrading to Xcode 8, I am facing lots of warning and error. Warning related to storyboard is solved but Error in pod files are not solved.

Xcode tell me to convert swift syntax to latest syntax so I did it. Swift syntax error shows in pod-files. I am trying to solve pod file swift syntax error then Xcode tell me to unlock pod-files, I did it but then pods are not working.

Is any one knows how to solve pod-files error? or How to convert whole Xcode 7.x project to Xcode 8?

3条回答
女痞
2楼-- · 2019-10-09 04:33

The final answer of above question is:

add the code snippet in your podfile

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

then check swift legacy in build settings and set it to NO for swift 3 or you can set Yes for swift 2.3 (if you are using objective-c pod repository)

Check all the pod repository one by one if its update contain swift3 code then fine or you can manually add code with swift 3 syntax by pull the request from github.

If my answer is wrong then edit it guys

查看更多
时光不老,我们不散
3楼-- · 2019-10-09 04:47

enter image description here There’s a single build setting that will let you continue building your Swift projects with a Swift version that’s mostly similar in syntax to your existing projects from Xcode 7: Use Legacy Swift Language Version

Just drop into your project’s build settings and search for legacy swift to find the correct build setting, then switch the setting to YES to opt-in to Swift 2.3 rather than Swift 3 in Xcode 8.
查看更多
萌系小妹纸
4楼-- · 2019-10-09 04:52

Step 1 : Open Project in Xcode 8.0

Step 2 : Go to Edit > Convertor > To Current Swift syntax.

enter image description here

Step 3 : Select in which swift version want to convert.

enter image description here

查看更多
登录 后发表回答