Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will Swift 2 apps works after Swift 3 released? [closed]

Tags:

ios

swift

swift3

I have released several apps written in Swift 2.0 and 2.1. Now Apple just open source Swift and announced that Swift 3.0 will be released next year. So will my apps still works after Swift 3.0's release?

like image 782
hklel Avatar asked Dec 04 '15 03:12

hklel


People also ask

What language is Swift based on?

Apple created Swift, an open-source programming language, as a replacement for all languages based on C, including Objective C, C++, and C. The language was created in 2014 and released to the public as an open-source project in 2015 on Swift.org.

Why did Apple invent Swift?

Swift is a robust and intuitive programming language created by Apple for building apps for iOS, Mac, Apple TV, and Apple Watch. It's designed to give developers more freedom than ever. Swift is easy to use and open source, so anyone with an idea can create something incredible.


2 Answers

I think you are asking two separate questions here.

  1. Will your app execute on the new OS when Swift 3 is launched?
  2. Will your app work on the new OS when it is launched?

In regards to the first question, yes your app will execute even though it was compiled against Swift 2. Swift apps have the Swift runtime libraries embedded in their bundles so you are safe in this regard. You will notice that Swift bundles are always about 4-5 MB larger than their Objective-C counterparts and this is precisely why.

In regards to the second question, as with any new OS release there is no guarantee that your apps will work as they did on previous versions of the OS. Although, from my experience Apple has done a pretty decent job of keep things backwards compatible over the last couple of OS releases, though your mileage may vary.

like image 73
Randy Avatar answered Oct 22 '22 07:10

Randy


If you're asking if your code written in Swift 2.0 / 2.1 will compile under Swift 3.0, it's possible that it won't. Quoted from Swift Programming Language Evolution:

Full source compatibility: Swift 3.0 will not provide full source compatibility. Rather, it can and will introduce source-breaking changes needed to support the main goals of Swift 3.0.

But like @Randy said, your previously-compiled app will still run.

like image 41
Clay Garrett Avatar answered Oct 22 '22 08:10

Clay Garrett