本文介绍了使用Swift 4.0编译的模块无法在Swift 3.2.1中导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在带有Xcode 9.0的Swift 3.2应用程序中,Swift 4.0模块很好.
Swift 4.0 modules were fine in Swift 3.2 apps with Xcode 9.0.
但是现在,有了Xcode 9.1,我得到了:
But now, with Xcode 9.1, I get:
或者:
推荐答案
Swift 4.0仅与Swift 3.2兼容.
Swift 4.0.1仅与Swift 3.2.1兼容.
Swift 4.0 is compatible with Swift 3.2 only.
Swift 4.0.1 is compatible with Swift 3.2.1 only.
所以:
- 您不能混用4.0和3.2.1
- 您不能混用4.0.1和3.2
- 您不能混用4.0和4.0.1
- 您不能混用3.2.1和3.2
用不同的方式表达:
- 您可以将Xcode 9.0支持的Swift版本混合在一起
- 您可以将Xcode 9.1支持的Swift版本混合在一起
- 您不能混合使用Xcode 9.0和Xcode 9.1 Swift版本
如果模块是由您构建的,则只需使用相同的Xcode对其进行重新构建.
如果模块是由第三方构建的,则请求Xcode 9.1兼容的构建.
If the module was built by you, simply rebuild it with the same Xcode.
If the module was built by a third party, request an Xcode 9.1 compatible build.
这篇关于使用Swift 4.0编译的模块无法在Swift 3.2.1中导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!