首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >xcode 8快速更新,出现错误"Use Legacy swift Language Version“

xcode 8快速更新,出现错误"Use Legacy swift Language Version“
EN

Stack Overflow用户
提问于 2016-09-21 20:46:30
回答 3查看 22K关注 0票数 19

当我在Xcode8中打开我的项目时,我得到以下错误

代码语言:javascript
复制
Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly

参考StackOverflow上的类似post,请使用旧版Swift语言版本是/否。但对我来说,做YES或No value都不起作用?

请帮帮忙。

我已选中使用旧版Swift语言版本选项是/否,请检查附件中的屏幕截图

EN

回答 3

Stack Overflow用户

发布于 2016-09-21 21:25:55

将以下内容添加到pod-file中:

代码语言:javascript
复制
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'yourappname' do

pod 'yourpodlists'

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

再次运行pod-install。使用cdm + alt + shift + k清理您的项目。再次使用cmd + shift + k进行清洁。重新启动Xcode。构建。现在它应该可以工作了。

如果您没有使用cocoapods,您应该能够通过将编译器版本属性Use Legacy Swift Language Version从未指定设置为是或否来修复此问题。

项目或库->的生成设置

票数 16
EN

Stack Overflow用户

发布于 2016-09-22 14:41:08

尝试将swift代码转换为swift3或swift 2.3。edit -> convert -> to current swift->选择swift 3或swift 2.3。这将会起作用。

票数 2
EN

Stack Overflow用户

发布于 2017-02-09 08:50:44

如果您没有使用pods,只需将此代码添加到您的Info.plist中-我在2.3

因为该选项未在构建设置中列出。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39616967

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档