Ωlo*_*stA 16 xcode ios swift swift2 swift3
我刚做了最后一次Xcode更新(8.3),我收到了消息:
对于使用Swift的目标,需要正确配置"Swift语言版本"(SWIFT_VERSION).使用[Edit> Convert> To Current Swift Syntax ...]菜单选择Swift版本或使用Build Settings编辑器直接配置构建设置.
知道刚刚从构建设置中删除了"使用Legacy Swift语言版本"选项,如何在不进行任何转换的情况下在Swift 2.3中生成我的应用程序?
要以编程方式更改Pod的快速版本,可以将其添加到Podfile中
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['Alamofire','OtherPod','AnotherPod'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
end
Run Code Online (Sandbox Code Playgroud)
在Swift 4中,如果您也使用Objective-C,
您可以打开@objc推断,以便swift项目将在Objective-c上正常运行。
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['Alamofire','OtherPod','AnotherPod'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_SWIFT3_OBJC_INFERENCE'] = 'On'
end
end
end
end
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
20922 次 |
最近记录: |