什么是“〜>”的用法在cocoapods [英] what is the usage of "~>" in cocoapods

查看:133
本文介绍了什么是“〜>”的用法在cocoapods的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道〜>用于什么,因为我发现它们在下面是相同的:

I want to know what the "~>" is used for,cause I find they are the same below:

pod 'AFNetworking','~> 2.0.3'

pod 'AFNetworking','2.0.3'


推荐答案

当你想指定一个版本时,使用〜> 乐观运算符) '直到下一个主要 | 次要 | 补丁。例如:

Well, ~> (the optimistic operator) is used when you want to specify a version 'up to next major | minor | patch'. For example:

〜> 0.1.2 将为您提供最高0.2(但不包括0.2和更高)的版本

~> 0.1.2 will get you a version up to 0.2 (but not including 0.2 and higher)

〜> 0.1 将为您提供高达1.0的版本(但不包括1.0及更高版本)

~> 0.1 will get you a version up to 1.0 (but not including 1.0 and higher)

〜> 0 将为您提供0及更高版本(与省略时相同)

~> 0 will get you a version of 0 and higher (same as if it was omitted)

其中 0.1.2 意味着'我想要这个确切的版本'

where 0.1.2 would mean 'I want this exact version'

这是关于此的更多信息

这篇关于什么是“〜>”的用法在cocoapods的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆