I want to use Hero framework. I don't get any pod command from their documentation. I have used pod "Hero". It's worked but after installing and downloading pod when try to open project it says
Xcode 9 does not support building or migrating Swift 2.x targets"
How can i solve this?
You can find the pod installation section in their documentation here.
If the process not work you try to read more...
This error means that XCode 9 does not offer any solution to migrate from Swift 2 to 4.
In fact into Build Setting you can switch from Swift 3.2 or 4.
You can try to open the project with XCode 8 firstly (that support Swift 2) and then after converting the library to Swift 3, reopen the project with XCode 9.
Related
I have just upgraded from xcode 10.1 to xcode 11.2.1. Now whenever I open my existing project in xcode 11.2.1 which was built in swift 3.0 it shows me "Unsupported Swift Version".
Please anyone can give me a brief description about it.
You cannot run swift 3 on Xcode 11. Download a version of XCode 10.1,You can run both.There will be option to migrate code to swift 4.
here you can download XCode 10.1:
XCode 10.1
Please check this link below. You can upgrade to swift 4.
https://medium.com/#hanif.awan2007/tips-upgrading-your-code-from-swift-3-to-swift-4-dbcba128b48b
You have a guide on official documentation:
https://swift.org/migration-guide-swift4/
First check you build settings:
You have an option "Swift language version" change this to swift4.
Then, try to compile and fix your warns / errors. Most of them can be automatically fixed by xcode.
If you got some pod dependencies, update it.
Go to project navigator> Build Settings. search for swift Compiler - Language and change this to desired version.
Is there a compiled IOS Audiokit framework I can download that's compiled for the latest Xcode using Swift 5 compiler? I'm unable to build my project until I can update my old framework. Tried building from the master folder but not getting anywhere with that. A new IOS download would be great. Thanks
You can use our staging pod, with instructions here: https://github.com/AudioKit/Specs
The currently pushed pod (version 4.7.b1 - must be specified explicitly) was built with Xcode 10.2 and Swift 5. We should have a new official release very soon.
UPDATE: v4.7 is officially out with Swift 5 compiled binaries.
I've downloaded Xcode 9 Beta 4 to fix a problem I have on my app in iOS 11.
However now Xcode won't let my build my app because Realm (and RealmSwift) are in Swift 3.1 and not 3.2.
Here is the message :
Module compiled with Swift 3.1 cannot be imported in Swift 3.2
I don't use CocoaPods or Carthage. Do you know how can I solve this issue ?
Make you selected command line tools for Xcode 9. You can find it Preferences -> Locations -> Command Line Tools.
Then clean your project and build again. Should work.
I'm using Xcode 7.3 but my project is in Swift 2.1. I don't want to update my codes right now. So how can I choose or download older version of Swift compiler? Many thanks in advance!
The following example is tested on Xcode 8.3 with swift 3.1
If you are using Xcode 8 you can download toolchains with needed Swift versions
1) Open this link:
https://swift.org/download/#releases
2) Download Toolchain with swift version that you need. For example I have 3.1 version of swift and downloaded swift 3.0.2
3) Open .pkg file and install it.
4) Open Xcode and select in menu:
Xcode -> Toolchains -> Select Swift Version you need.
That is all folks
Originally I posted this is a comment, but I should have just posted it as an answer:
If you're writing an app for the App Store, you can only use a release (non-beta) version of Xcode (see “Submitting Apps to the App Store using Xcode”) and the toolchain supplied with that version of Xcode (see “Using Downloads / Apple Platforms”). So you can either use Xcode 7.2 and continue using Swift 2.1, or you can use Xcode 7.3 and update your code to Swift 2.2.
You can have multiple versions of Xcode installed. You can keep Xcode 7.2 installed and use it for your non-updated Swift 2.1 projects, and use Xcode 7.3 on new projects. Note that you'll have to manually open each project in the appropriate version of Xcode. You can download old versions of Xcode here.
If you're not going to put your app in the App Store, then maybe you could extract the Swift 2.1 toolchain from the Xcode 7.2 bundle and turn it into a .xctoolchain for use with Xcode 7.3, but you're really in unexplored, unsupported territory if you go that route.
If you're following the answers involving a .xctoolchain combined with Xcode 9 beta you'll encounter an error similar to this:
<unknown>:0: error: unknown argument: '-index-store-path' Command /Library/Developer/Toolchains/swift-3.1.1-RELEASE.xctoolchain/usr/bin/swiftc failed with exit code 1
The reason is that Apple has added a new feature/argument, which hasn't made its way to open source Swift yet. You can get around this issue by launching Xcode from the command line with the feature disabled like this:
/path/to/Xcode-beta.app/Contents/MacOS/Xcode -IDEIndexEnableBoltIndex NO
Thanks to the Swift team
Xcode 9 - Xcode 10
Select your target, then in your Build Settings, search for "swift language" and then you will find Swift Language Version.
First off, if I write an app in swift2 and ship it to app store. Will it be available/work for people still running iOS 8 ?
Right now I have written an app using swift 1.2. But I dont know how I should convert it into swift 2. Should i first update my podfile to use pods with swift 2.0 then run pod install, and after that I run the code migrator in xcode in order to upgrade my own code?
Thanks in advance,
You can use the latest version of Swift, and it will build and run on any version of iOS starting with iOS7. You certainly would want to migrate to Swift 2 because it's very much improved.
Cocoa pods is a separate issue, but you should use the latest version that works with the latest version of Swift.
Set the Deployment Target to the lowest version of the OS you wish to support, and Xcode will present an error if you try to use something (e.g.: an API call) that's not supported.