what is the usage of “~>” in cocoapods

后端 未结 4 1800
一整个雨季
一整个雨季 2020-12-24 04:47

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\'
         


        
4条回答
  •  情深已故
    2020-12-24 05:26

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

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

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

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

    where 0.1.2 would mean 'I want this exact version'

    Here is some more info on this

提交回复
热议问题