gpt4 book ai didi

ios - 不同iOS版本的cocoapods

转载 作者:行者123 更新时间:2023-11-29 01:31:36 35 4
gpt4 key购买 nike

自从 iOS 9 发布以来,我想为用户提供坚持使用 iOS 8 或只使用最新版本的 SDK 的可能性。

在 git 上创建双分支很容易,但我如何在 CocoaPods 中处理这个选择?我如何让用户选择要下载的 SDK 版本,即使我不断更新和扩展 iOS 8 和 iOS 9 版本?

让用户选择的唯一方法可能是完成 iOS 8 版本,然后才开始发布 iOS 9,放弃另一个。我希望我是不对的。

提前致谢。

最佳答案

您可以在 pod 文件中指定要在您的项目中使用的 cocoa pod 版本。

Besides no version, or a specific one, it is also possible to use logical operators:

'> 0.1' Any version higher than 0.1 '>= 0.1' Version 0.1 and any higher version '< 0.1' Any version lower than 0.1 '<= 0.1' Version 0.1 and any lower version In addition to the logic operators CocoaPods has an optimistic operator ~>:

'~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and higher '~> 0.1' Version 0.1 and the versions up to 1.0, not including 1.0 and higher '~> 0' Version 0 and higher, this is basically the same as not having it.

假设您的 iOS 8 支持的 SDK 是 v1.0.0,而您的 iOS 9 支持的 SDK 是 v2.0.0。

如果您的用户正确设置了 pod 文件(iOS 8 仅使用 ~> 2.0. 0 和 iOS 9 只使用 >= 2.0.0),他们应该没有什么可担心的。

关于ios - 不同iOS版本的cocoapods,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33402875/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com