Does Swift 2 work on iOS 8? - ios

When building with Xcode 7 beta using Swift 2, can iOS 8 devices be used as deployment targets?
I remember that swift runtime gets embedded as dynamic framework so each app uses its own version of swift instead of iOS's version of swift, but I can't be sure.
On a related note, as of July 12, can you submit app to app store containing Swift 2?

Related

Apple requiring all app updates to built with iOS 12 SDK by March 2019 Question

I'm currently using Xcode 9 but I have downloaded and "installed" the iOS device support files for 12.
Am I good to go for the March iOS 12 deadline?
Is satisfying the requirement as simple as submitting a new build when needed with my current setup or is more work required?
You need to migrate to Xcode 10 to get the iOS 12 SDK support files. Your app must be build with this iOS 12 sdk support. This is not the same as pulling iOS 12 device support into Xcode 9 from Xcode 10.x versions. Currently, going directly to 10.1 is the best move. Fortunately, Swift 3 and 4 are currently supported in Xcode 10.1. So if you are still on Swift 3 you will not have to also migrate your swift version.
Xcode 10.2 (currently in beta) will add support for swift 5. Migrating from Xcode 10.1 to 10.2 will require you to be on Swift 4.2 as a minimum version, with Swift 5 being recommended.
After the deadline, any app submissions will need to be built with Xcode 10 or better, or else they will be rejected.

Which swift version for iOS 7+

I'm new to iOS development, trying to develop an application.
Once I've seen in these statistics that iOS 7 has a really small market share I decided to support iOS 7 or higher in a way to make an app to all iphone OS available in the market. I also decided to use swift as code language but not sure which swift version should I choose.
Which swift version should I choose for iOS 7 or higher development?
Apple states that
Starting July 2018, all iOS app updates submitted to the App Store must be built with the iOS 11 SDK and must support the Super Retina
display of iPhone X.
(The same requirement for new apps started on April 2018.)
So, your choice are very few, Xcode 9 (with iOS 11 SDK) or Xcode 10 (with iOS 12 SDK).
(I believe we should read the requirement as iOS11 SDK or later.)
And supporting iOS 7 with Xcode 9/10 is very difficult. (I do not know if it is possible or not.) Deployment Target does not accept versions less than 8.0 (*), and iOS 7 Simulators are not provided.
(*) Some versions of Xcode replaces versions less than 7.0 to 8.0, even if I entered the version number manually. And at least, both Xcode versions does not show 7.x in the popup menu of the Deployment Target.
I recommend you to use the latest released version of Xcode (10, which comes with Swift 4.2), and make your minimum supported version to iOS 8.0 or later.
The Swift application will work only on iOS 7+. The Xcode will add the Swift library to every build so, you can use any version of Swift language and all of them will work on all iOS starting from 7th. Apps created with Swift will run on iOS 7+ and Mac OS 10.9 +
so use the latest version always.
You have to use the latest swift version Swift 4.2
As iOS 12 is out now so you have to use iOS 10 and above because we should support recent 3 versions.
Images source
If you target iOS 10 and above then you hit the 95% users

Can I submit code written in Swift 4 to the App Store with Xcode 8.3.2?

I would like to use the Xcode 9 beta for use in development but I can't seem to get the correct settings for using Swift 3.2 within Xcode 9. The editor is much quicker than Xcode 8.3.2
I can (and have) downloaded the Swift 4 toolchain from swift.org and can use it from within both Xcode 8.3 and the Xcode 9 beta. If I wanted to ship my app before Xcode 9 is officially released, could I write it in Swift 4 and then submit it to the App Store via Xcode 8.3 using the Swift 4 toolchain?
No, you cannot submit a binary that contains code built with the Swift 4 toolchain (or any development toolchain for that matter) to the Apple App Store using Xcode 8.3.2.
Jordan Rose, a Swift compiler engineer at Apple, tweeted:
Development toolchains are never used when submitting to the store, sorry! (We want to avoid XcodeGhost-like scenarios.)
Thus, this configuration is not supported and you will need to wait for Xcode 9 to ship projects using Swift 4. Your binary will be rejected.

How Long Will Swift 2.3 Apps Be Accepted on the App Store?

I'm currently building a Swift 2.3 app that I plan to release on the App Store in Q2 2017.
I know Swift 3 is out now, and that technically-speaking it would be better for the project to switch to Swift 3.
But I have some very important librairies that I use in my app, an they will not be updated to Swift 3 until several months, at least.
So, as you understood I have a foot in each camp now.
What should I do ? And more importantly, until when will Swift 2.3 apps be accepted on the App Store ?
Will the retro-compatibility of Swift 3 with Swift 2.3 Librairies be implemented anytime soon?
Thanks,
Xcode 8.2 (which is in beta currently) will be the last version of Xcode to support Swift 2.3. I would encourage you to transition to Swift 3 as soon as you can.
Application binary interface (ABI) stability will most probably be in Swift 4 to be released in the later part of 2017. This means that from that point forward, the binaries will be compatible. Swift 2.3 binaries will never be compatible with Swift 3, and Swift 3 binaries are very unlikely to be compatible with Swift 4. However, Swift 4 libraries should be compatible with later versions.
Now Apple Not Accept Your Project on the App Store.
Update your version of Xcode to the latest release of Xcode 9 available on the Mac App Store, which includes the iOS 11 SDK, and build your apps. Starting July 2018, all new iOS apps and updates submitted to the App Store must be built with the iOS 11 SDK. All new iOS apps and updates for iPhone, including universal apps, must support the Super Retina display of iPhone X.

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.

Resources