2

What is the min iOS which works well with Swift 5.1 or incoming Swift 5.2?

Are there any references to check this?

VSB
  • 9,825
  • 16
  • 72
  • 145

1 Answers1

2

A similar question has been asked before, when Swift 4 came out. You can find the question and answer here.

Having that said, the swift.org site and the release notes only specify the compatibility with previous Swift versions, the operating systems and the toolchain (Xcode). So, a straight forward answer can't be given to this question.

Since Swift 5.1 is compatible with Swift 4, you can safely assume the code will run iOS 11 and probably iOS 10 as well. There are, however, some incompatibilities between Swift 5.1 and Swift 4, see for the details this link. I think you should also be aware of the fact that as of iOS 11 32 bit is not being supported anymore.

The next issue you will definitely run into are the deprecated functions in iOS. You have to build your code in the productive version of Xcode and that tool will throw errors and warnings for deprecated functions or variables being changed. For instance, the key "[UIImagePickerControllerOriginalImage" has been changed to "UIImagePickerController.InfoKey.originalImage". at the moment Xcode 11.3 doesn't let you specify below 12.1, so you will run into these problems when updating source code written in an older version.

dandan78
  • 13,328
  • 13
  • 64
  • 78
MacUserT
  • 1,760
  • 2
  • 18
  • 30
  • Since I'm going to develop brand new application, If I set my deployment target to iOS 10 and I'm going to use Swift 5.1 will any problem occurs? This way I can still support 32-bit phones. I think it is hard to map iOS and Swift and phone coverage together. At least for me :D – VSB Dec 22 '19 at 13:46
  • In other words, If i want to try Swift 5.1 using iOS 10 or 9 as deployment target what I will lose? – VSB Dec 22 '19 at 13:52
  • The question is what Xcode version are you going to use if you develop a brand new app? In Xcode 11.3 I can only select iOS 12.1 as the lowest iOS version. – MacUserT Dec 22 '19 at 13:59
  • Really? Are there any notes on this on Xcode releases? – VSB Dec 22 '19 at 14:10
  • I've found this: https://developer.apple.com/documentation/xcode_release_notes/xcode_11_3_release_notes. It says: Xcode 11.3 supports on-device debugging for iOS 8 and later, tvOS 9 and later, and watchOS 2 and later. Xcode 11.3 requires a Mac running macOS Mojave 10.14.4 or later – VSB Dec 22 '19 at 14:11
  • This means, to my opinion, that if you have iOS 8 code in your app, Xcode will still understand the symbols and allow you to debug the code. However, if you start a new project in Xcode and you go to the project overview to select the iOS deployment target, you can only select 12.1 as the lowest version. That means to me, that new apps can only be developed for iOS 12.1 and up. – MacUserT Dec 22 '19 at 14:42