Search code examples
iosswiftabi

How does Swift 5 ABI stability affect iOS app that supports iOS 11?


Swift 5 brings ABI stability, so iOS app written in Swift no longer need to package the swift standard libs into the app bundle. How does this affect the apps that still supports iOS 11, which doesn't have swift libs pre-installed? If those libs still need to be bundled into the app, what's the immediate benefits to upgrade to Swift 5 now?


Solution

  • It's exactly like any Swift language upgrade (from 1 to 2, or 2 to 3, or 3 to 4, or 4 to 4.2, or whatever).

    On iOS 11 (indeed, on anything earlier than iOS 12.2), the Swift libraries still have to be bundled into the app, so the app won't be any smaller. Thus the "immediate benefits to upgrade to Swift 5 now" is the improvements in the language itself (including the compiler and build process and internal bug fixes) since Swift 4.2.

    There is usually no reason not to upgrade. You should always use the latest Swift, if possible, if only because it makes it easier to ask questions about your code on Stack Overflow! But also because newer is always better.