I completed a few months ago a project with 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?
You are mixing Swift 3 and Swift 4 in your project. Because Swift 3 and Swift 4 are not source-compatible, this can not work. You need to either use Swift 3 for everything, or Swift 4 for everything.
For CocoaMQTT there is a Swift 4.2 version available since Oct 12, 2018.
SwiftyTimer looks abandoned, and there is no Swift 4 version of it yet (Oct 2018). It has been used by CocoaMQTT previously, but they have dropped that dependency with the new version. So there should be no problem once you upgrade CocoaMQTT, unless you are using SwiftyTimer yourself.
You will need to support Swift 4 eventually (if not now, then in 1 year maybe). Maybe you can get away with staying with Swift 3 for now..
Related
I keep downloading sample codes and many times it says "Unsupported Swift Version 3.x...Use Xcode 10.1 to migrate the code to Swift 4".
Why is it not possible to migrate to Swift 4 using Xcode 10.3 or Xcode 11 beta?
More importantly, I am using Swift 4.2 in my own Project that has several dependancies as well through Pods. If I don't upgrade to Swift 5.1 or later, it seems my own project would start getting such errors in Xcode 12 or so, correct? While I can convert my own code to Swift 5.1, I have no idea if dependencies such as SwiftyDropbox would migrate to Swift 5.1 so easily. What implications it would have for my project in future and what could I do to future proof my project in that case?
Ask Apple. The company has decided – certainly for good reasons – to migrate files only to the Current Swift Syntax. Feel free to create legacy system partitions with older versions of Xcode to migrate code step by step.
The grace period to update the Swift version is long enough to ensure a smooth transition. At least Xcode allows to use the 3 most recent Swift versions in the same project. However you are responsible to maintain the version control. Check the dependencies periodically for updates. If a dependency is not able to release an update within the grace period it's not much good.
Its been a very tough for me to get a suitable answer for this Question as I know the solution but the reason is still unknown
Let me explain the question properly, when we make any projects like in swift 3 or lower version in lower versions of Xcode like 7 or 8
Its Doest run in new Xcode version like 9 we have to change the Swift_version in build settings to make it work.
Why doest it happen why Xcode doesn't support all versions of swift like I can show us deprecated warning rather then throwing error
for Obj c It works in all Xcode whatever Xcode you use it supports Obj c
Because Xcode 9 does not ship with older Swift versions. You need to update your Swift code.
Generally, Xcode also does not support older Obj-C versions, but Obj-C syntax hardly changes from year to year, that is why Obj-C code that you wrote in Xcode 7 runs in Xcode 9. But this was not the case for Obj-C code you wrote in say Xcode 2 or lower.
I cannot get Backendless to compile in Xcode 8 with iOS 10 and Swift 3. I have updated to the latest version of Backendless-iOS-SDK via CocoaPods. Every time I try to compile, I am met with numerous errors in the parts of my code that access the Backendless SDK. Every time I fix the errors, countless more appear when I try to run. This makes me think I have done something wrong during the process of upgrading the SDK.
Any ideas what could be happening here? Is it expected that all my code that accesses Backendless needs to be changed when upgrading to Swift 3? (Please note that I have ALREADY Converted to the latest Swift 3 syntax).
Is the Backendless SDK now compatible with Xcode 8 and Swift 3?
Any ideas what could be happening here? Is it expected that all my code that accesses Backendless needs to be changed when upgrading to Swift 3? (Please note that I have ALREADY Converted to the latest Swift 3 syntax).
Yes, you might need to change the code if its not converted by the migrator.
Is the Backendless SDK now compatible with Xcode 8 and Swift 3?
Yes, because the Backendless SDK is in Objective C so there will be no issues using it.
There is issue on swift3 installation via cocoa pod as of the moment.. please use option 2 in the documentation... importing the lib adding it manually is better.
Although swift 3 is released, I don't want to update my code just yet, because a lot of the CocoaPods I used are still in swift 2. I don't know what the migrator will do to those pods. Will they remain unchanged, causing the project to not build successfully? Or will they be migrated to Swift 3 as well? I don't know!
On the other hand, I really want to try out the new syntax and other new features in Swift 3. They seem really cool!
How can I continue developing my existing projects with Swift 2, but for other projects, compile with Swift 3?
In other words, how can I choose a compiler for a project?
How can I continue developing my existing projects with Swift 2, but for other projects, compile with Swift 3?
Install both Xcode 7 (which has Swift 2) and Xcode 8 (for Swift 3) and use the xcode-select command line tool to switch between them.
I have a few issues concerning the recent addition of Swift 2.0 and upcoming iOS9.
Currently I have been working on an app that works with iOS7 or above, and using Swift 1.2 things...nothing that Swift 2 has. I was told that I should start updating everything to include Swift 2 rather than the older ways of using Swift. So my questions are...
1) If I do begin to work with Swift 2 code, will iOS 7 and iOS 8 be able to recognize that code, or does Swift 2 only work with certain versions of iOS?
2) If I choose NOT to work with the Swift 2 code and stick with what I have that works already for iOS 7 and 8, is it possible that in iOS9 or later, it won't work because it expects Swift 2 and it's not getting it?
I have looked for compatibility articles and answers online and found nothing. The only thing I've learned is that Swift 2 just adds code, and doesn't necessarily change anything...so maybe just keeping my old code would be okay. But again I'm not exactly sure. Thanks.
The code will work as far back as iOS 7 for right now, regardless of what version of Swift you are using. As far as whether you should update your code, that's up to you, but of course Swift 2.0 does offer a lot more in terms of safety and error checking so if you find situations where it would be pertinent to implement such new features, then you probably should. Also some syntax is different, but if you update now you'll just be future-proofing yourself.