Swift compatibility between versions for a library

前端 未结 2 1846

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 22:45

    Until the Swift ABI (application binary interface) stabilises (I'm guessing another year or two) the only way to distribute libraries that will work across different Xcode versions is to distribute the source code. Cocoa pods and Carthage are both good tools for making library distribution easier but for Swift code they will still rely on source code being available.

    It might be possible to have an Cocoapod that detects the version of Xcode it is run with and then downloads and provides the correct build of your library but you will still need to build the libraries for all Xcode versions that you want to support and recompile every time Apple release a new Xcode but at least the user wouldn't need to download a new version manually.

提交回复
热议问题