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'
Podfile. lock is used to make sure that every members of the team has the same versions of pods installed on the project. This file is generated after you run the command: pod install. It gets updated when you run pod install or pod update.
The Podfile is a specification that describes the dependencies of the targets of one or more Xcode projects. The file should simply be named Podfile . All the examples in the guides are based on CocoaPods version 1.0 and onwards.
0. CocoaPods manages library dependencies for your Xcode project. You specify the dependencies for your project in one easy text file. CocoaPods resolves dependencies between libraries, fetches source code for the dependencies, and creates and maintains an Xcode workspace to build your project.
~>
(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
~> 6.0
will get you the latest version before the next version which is 7.0
but not including the 7.0
version.
~> 6.0.0
will get you the latest version before the next version which is 6.1.0
but not including the 6.1.0
version.
🎉
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.
For more information, regarding versioning policy, [see][1]:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With