Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zenangst/Versions
:sparkle:Helping you find inner peace when comparing version numbers in Swift.
https://github.com/zenangst/Versions
Last synced: 4 months ago
JSON representation
:sparkle:Helping you find inner peace when comparing version numbers in Swift.
- Host: GitHub
- URL: https://github.com/zenangst/Versions
- Owner: zenangst
- License: other
- Created: 2015-03-02T09:05:49.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-10-25T19:51:20.000Z (over 5 years ago)
- Last Synced: 2024-10-15T12:10:43.202Z (4 months ago)
- Language: Swift
- Homepage:
- Size: 372 KB
- Stars: 208
- Watchers: 7
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-swift - Versions - Helping you find inner peace when comparing version numbers in Swift (Misc)
README

Helping you find inner peace when comparing version numbers in Swift.
Comparing with the current applications version couldn't be easier.
```swift
// App.version is 1.0.0
if App.version.olderThan("2.0.0") {
// Prompt user to update
}
```But you can apply this to more things than just the `CFBundleShortVersionString`.
```swift
let currentVersion = "1.0.1a"
if currentVersion.olderThan("1.1.3") {
// update
}
```Versions also support semantic versioning (`Major`, `Minor`, `Patch`)
```swift
if "1.0".semanticCompare("2.0") == Semantic.Major) {
// major update
}
```## CocoaPod
[](http://cocoapods.org/pods/Versions)
[](http://cocoapods.org/pods/Versions)
[](http://cocoapods.org/pods/Versions)Verisons is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "Versions"
```## Contribute
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create pull request## Who made this?
- Christoffer Winterkvist ([@zenangst](https://twitter.com/zenangst))
- Kostiantyn Koval ([@KostiaKoval](https://twitter.com/KostiaKoval))