Swift compatibility between versions for a library

前端 未结 2 1847

I\'m distributing libraries for other developers to use (http://empiric.al). I\'ve noticed that between swift versions, even 2.0 to 2.1, I\'ll get Module file was crea

2条回答
  •  误落风尘
    2020-12-03 23:05

    From Apple's website:

    Binary Compatibility and Frameworks

    While your app’s runtime compatibility is ensured, the Swift language itself will continue to evolve, and the binary interface will also change. To be safe, all components of your app should be built with the same version of Xcode and the Swift compiler to ensure that they work together.

    This means that frameworks need to be managed carefully. For instance, if your project uses frameworks to share code with an embedded extension, you will want to build the frameworks, app, and extensions together. It would be dangerous to rely upon binary frameworks that use Swift — especially from third parties. As Swift changes, those frameworks will be incompatible with the rest of your app. When the binary interface stabilizes in a year or two, the Swift runtime will become part of the host OS and this limitation will no longer exist.

提交回复
热议问题