Can you still program in xcode 7 with swift 2? - ios

Im working on a school project to build an iOS application in Swift. I saw that they updated to Swift 3.0 and now many tutorials don't work. My question is can you download xCode 7.3.1 and still work in Swift 2? So that I can follow the tutorials on the web?
My application only has to work on a emulator. So not in de App store
Thanks!

Yes you can use swift 2.2 in Xcode 7 and 2.3 in Xcode 8 by enabling the Use Legacy Swift Language Version in Build setting (SWIFT_VERSION = 2.2)
Swift 2.2.1 and Swift 2.3 are very similar, with key changes being related to SDK differences.

Related

Xcode 8.3 Beta No option in setting for Use Legacy Swift Language Version

I developed my project in SWIFT 2.3, but there is one issue:
MPMoviePlayerController iOS fullscreen function has wrong icon in iOS10 you can also see this in developer forums..
https://forums.developer.apple.com/thread/69735
I download new Xcode 8.3 beta for check this problem, but I am not able to run my project in Xcode 8.3 beta version, because there is no option in build setting Use Legacy Swift Language Version
And I read release note of Xcode8.3 beta version, here apple mention that :
Xcode 8.3 no longer supports Swift 2.3. Please migrate your projects containing Swift 2.3 code to Swift 3 syntax by opening the project and choosing Edit > Convert > To Current Swift Syntax.
My question is now on word is it compulsory to convert code in Swift 3.0?
I am trying to convert that project in new Swift 3.0 but I am getting more then 700 error.
Can any one help me how can I convert easily?
Thanks in advance.

Upload new iOS 10 application built by older Xcode 7

I've a simple question. What are requirements for new app upload to latest AppStore?I mean is it required to use latest Xcode 8 and also latest swift or is it possible to upload the new application running on swift 2.2 version using Xcode 8 or maybe with Xcode 7? I'm curios if apple states informations like that somewhere.
Apple recommends you to build and submit to App store with latest SDK. However, it doesn't mean that it forces you to do that. In other words, you can use older SDK to compile you source code. For example, you can compile you app with XCode8 with Swift 3, but if you do with XCode7 and Swift 2.2, it's also fine.
Have a look at this: https://developer.apple.com/library/content/qa/qa1806/_index.html

Building frameworks for iOS 8 and above in XCode 8

I have recently updated to Xcode 8. Previously I was using Xcode 7 with Swift 2.2.
I have a framework that I built in with deployment target iOS 9.3. Now that I have moved to Xcode 8 I cannot use this framework.
Is there a way I can build a framework that will work for iOS sdks 8 and above?
I want to set the minimum deployment target of my app to iOS 8+.
Also
Alamofire for Swift 3 has been updated and I have updated my pod file.
Will I be able to run the app in iOS versions above 8?
Any help will be appreciated.
Yes it is possible to build frameworks for iOS 8 with Xcode 8. But if you try to support iOS 8 you could also use Swift 3, put If you use other frameworks like Alamofire, you have to be careful, because the latest version of Alamofire (4.x) requires a minimum iOS target version of iOS 9. So you have to use Alamofire (3.x). With Alamofire 3.5 you have to use Swift 2.3
So first you have to decide what's more important for you:
iOS 8 support: So you have to switch to Swift 2.3 and Alamofire 3.x
Swift 3 support: So you have to drop iOS 8 support, because Alamofire 4.x requires iOS 9
As you know that Xcode 8 supports only Swift 2.2 and Swift 3. Your framework is built on top of Swift 2.2. So there is no way that you can run or build the project in Xcode 8, you will get an error like "The project has an older version of Swift, Please build it with newer version of Xcode".
You can use Xcode 8 and you can set minimum deployment target to iOS 8. But you can't use any of the new Swift 3 features in there, I mean you can use it but it will not execute in iOS 8. For that you have to write code with class or API availability checking for each snippet you write.
If you use new version of Alamofire there is no chance that you can use it in iOS 8.0. You need an older version of it. Because Alamofire new version is Swift 3 and have minimum deployment target of iOS 10 I think.
So it is better to convert your project into Swift 3 or to Swift 2.3. That is the best way to solve this situation. Otherwise you will see more lot of problems eventually.

Upgrading a Swift 1.1/1.2 project from Xcode 6 to Swift 2 project on Xcode 7

I have a project that I've been working on with my friend on Swift 1.1/1.2.
Unfortunately, when I upgraded my Xcode to the latest version, I noticed that the app will no longer compile and there are lots of errors.
Is there a way for Xcode 7 to compile for Swift 1.2?
If not, how do I get the old version of Xcode which does not use Swift 2?
Is Swift 2 app backward compatible with Swift 1 apps?
Can Swift 1.2 app run on iOS 9?
Are most developers using the Swift 2 now or not?
In Xcode start with Edit->Convert->To Latest Swift Syntax...
You may still have errors that you will have to resolve manually. Read the Xcode Release Notes to see what changed in Swift 2.

swift will I be forced to remake my app's code when swift 2.0 is released

I have made an app using swift 1.2.
Will I be forced to rebuild my entire using swift 2 when its released?
Or can I still make updates to my app using swift 1.2 code?
It's my understanding that Xcode 7 uses Swift 2, and Xcode 6.x uses Swift 1.2.
Apple will probably continue to support Xcode 6.x for some time after Xcode 7 goes GM. During that time you should be able to support your Swift 1.2 code. However, it's not a good idea to depend on old developer tools. You should think about migrating to Swift 2 once Xcode 7 is released.
When i used xcode 7.beta 4, i converted my code for swift 2. when i ran the same code with xcode 7.beta 5, again i ran into few more swift related errors. better keep calm until Apple releases the final xcode version which supports swift 2+

Resources