39

So Swift 2.0 is coming up with Xcode 7, what is the minimum iOS / OS X system version required to use Swift 2.0?

Andrey Tarantsov
  • 8,965
  • 7
  • 54
  • 58
CarmeloS
  • 7,868
  • 8
  • 56
  • 103
  • 8
    May I ask why you guys are down voting this question? – CarmeloS Jun 14 '15 at 14:31
  • CarmeloS , I completely agree with you (y down voting). I know Swift 2.0 beta is released few days ago , but this is a valid question and not clearly mentioned in documentation atleast . I think only after hands-on with xcode7 beta we can come to the conclusion. I cannot help you right now ,I have to try Xcode7. – Alphonse R. Dsouza Jun 14 '15 at 19:30
  • 6
    Why the _hell_ is this down voted? I couldn't find this info anywhere on Apple's website or in WWDC videos, this seems literally to be the only place on the Internet attempting to answer this _crucial_ question about Swift 2. – Andrey Tarantsov Jun 18 '15 at 13:51
  • Also, this may become a duplicate of http://stackoverflow.com/questions/24001778/do-swift-based-applications-work-on-os-x-10-9-ios-7-and-lower _if and when_ the answers get updated for Swift 2. – Andrey Tarantsov Jun 18 '15 at 13:55
  • There is now an entry about this issue in the Apple developer forums: https://forums.developer.apple.com/thread/3761 – Nicolas Miari Jul 06 '15 at 05:27
  • Agreed - this question does not deserve down-votes. This information is difficult to find through official channels. Answerers, please cite your sources and answer for both iOS and Mac, per the OP's actual question. – Joshua Nozzi Jul 28 '15 at 14:34
  • There are people who are here to downvote without any reason, it would help if they tell the reason for downvoting but they simply do it. – iOS_Developer Jul 26 '16 at 20:11

3 Answers3

16

An Apple staffer had this to say:

iOS 7 / OS X 10.9, same as Swift 1.0.

Update: I'm guessing this is because the runtime is packaged into the built app / library / framework / whatever the same as with Swift 1.x.

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135
  • Has anyone actually tried this with iOS 7? I upgraded to Yosemite and the simulator doesn't work for iOS 7 (other slightly related thread). But can you attack an iPhone 4 by USB and debug like that? Can you deploy to the App Store? – Brian Birtle Jan 11 '16 at 05:09
  • It's not that Swift isn't supported on iOS 7; it's that Apple doesn't want to allow new App Store submissions targeting outdated versions of their OS. Not only can you not submit to the App Store but the latest versions of the tools themselves don't include some of the necessary support. – Joshua Nozzi Jan 26 '16 at 23:00
5

I've tested it as far a iOS 7, no clue on anything lower however you probably shouldn't be supporting iOS 6 anymore.

David Wong
  • 10,284
  • 3
  • 39
  • 34
4

I couldn't find an official response anywhere, but they implied that Swift 2.0 will deploy back to iOS 7 in a couple of WWDC 2015 presentations.

  1. Session 403: Improving Your Existing Apps with Swift (http://asciiwwdc.com/2015/sessions/403), where they mention the availability feature in Swift 2.0:

Because they all want you to support these old versions, iOS 7, 8, and now 9 is probably going to be on slate for this fall for many of you.

So to do that, we have this new availability feature introduced in Swift 2.0.

So as long as you are writing some code in Swift 2.0, we have a great way to check to see what SDK you are on and if you can actually use this feature or not.

  1. Session 411: Swift in Practice (http://asciiwwdc.com/2015/sessions/411), where they talk about the Swift 2.0 availability feature:

But if I slide all the way back to deploying to iOS 7, the compiler can see, just as we can read on this slide, that it's unsafe to use this method, request when in use authorization. And the compiler will tell you that this is just unsafe code. And it's an error. It will literally prevent you from building this code. And it will give you a nice safety check.

Community
  • 1
  • 1
yood
  • 6,650
  • 3
  • 26
  • 24