简体   繁体   English

Swift 4-CocoaMQTT不兼容了吗?

[英]Swift 4 - CocoaMQTT not compatible anymore?

I completed a few months ago a project with CocoaMQTT. 几个月前,我与CocoaMQTT完成了一个项目。 Now I want to do a new project and I created the files like the one before. 现在,我想做一个新项目,并像以前一样创建文件。 Now I get this error-codes. 现在我得到了这个错误代码。 When I click the button to update the Code, I get new error-codes. 当我单击按钮以更新代码时,我得到了新的错误代码。 Got someone the same problem or know a solution? 是否有人遇到相同的问题或知道解决方案?

错误代码

错误代码_1

You are mixing Swift 3 and Swift 4 in your project. 您正在项目中混合使用Swift 3和Swift 4。 Because Swift 3 and Swift 4 are not source-compatible, this can not work. 由于Swift 3和Swift 4不兼容源,因此无法正常工作。 You need to either use Swift 3 for everything, or Swift 4 for everything. 您需要为所有内容使用Swift 3,或者为所有内容使用Swift 4。

For CocoaMQTT there is a Swift 4.2 version available since Oct 12, 2018. 对于CocoaMQTT,自2018年10月12日起提供Swift 4.2版本。
SwiftyTimer looks abandoned, and there is no Swift 4 version of it yet (Oct 2018). SwiftyTimer看起来已经废弃了,目前还没有Swift 4版本(2018年10月)。 It has been used by CocoaMQTT previously, but they have dropped that dependency with the new version. 以前,CocoaMQTT曾使用过它,但是新版本中不再使用这种依赖。 So there should be no problem once you upgrade CocoaMQTT, unless you are using SwiftyTimer yourself. 因此,一旦您升级CocoaMQTT,就不会有问题,除非您自己使用SwiftyTimer。

You will need to support Swift 4 eventually (if not now, then in 1 year maybe). 您最终需要支持Swift 4(如果不是现在,则可能需要1年)。 Maybe you can get away with staying with Swift 3 for now.. 也许您可以暂时不使用Swift 3。

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

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