-2

I work on a suite of internal libraries that are distributed via Cocoapods. Our current minimum deployment version is 14.0. We've got the Podspec for each library setting the Swift version to 5.3, which was the version that shipped with Xcode 12.0, which shipped alongside iOS 14.0.

I was under the impression that if we upgraded to Swift 5.8 in order to use newer Swift features (such as concurrency), we would have to embed the newer Swift runtime with our library to make it work properly. However, I just did a small test where I made an iOS 14.0 app that imported a Cocoapod using Swift 5.8 and also used Concurrency and the file size seems to be no larger than the same app with a Swift 5.3 Cocoapod and no concurrency usage.

Can we just move to Swift 5.8 without impacting our library integration size?

Joshua Sullivan
  • 1,073
  • 8
  • 12
  • I don't know what you think you mean by "library integration size" but haven't you answered your own question? – matt Apr 12 '23 at 19:52
  • Xcode just will add required dylib in the resulting application. But it may be already the if Concurrency is already used in the app. – Cy-4AH Apr 12 '23 at 20:54

1 Answers1

0

Okay, so it turns out that the Swift version has NO BEARING on the compiled app. This is because there's no Swift in the compiled app, just machine binary. That said, if you use Concurrency, Xcode will force the inclusion of the concurrency library libswift_Concurrency.dylib in apps with a deployment target lower than iOS 15.0.

Joshua Sullivan
  • 1,073
  • 8
  • 12