Create ios Swift Framework independent of Xcode Compiler Version

Problem we faced that we have to create .framework file for each Xcode version as each Xcode has different compiler version

  • 11.0 => 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)

  • 11.1 => 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)

  • 11.2 => 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9)

  • 11.3 => 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)

  • 11.3.1 => 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)

  • 11.4 => 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)

  • 11.4.1 => 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)

When we try to import framework build with Xcode 11.4 in Xcode 11.0, it gives error "Module compiled with Swift Version 5.2 compiler cannot be imported in compiler version 5.1

Any Solution for this as we can not ask our clients to change Xcode Versions.

Answered by OOPer in 686936022

Have you tried setting BUILD_LIBRARY_FOR_DISTRIBUTION?

Library Evolution in Swift

Accepted Answer

Have you tried setting BUILD_LIBRARY_FOR_DISTRIBUTION?

Library Evolution in Swift

Create ios Swift Framework independent of Xcode Compiler Version
 
 
Q