https://github.com/cleancocoa/version
Swift µ-library to express semantic version numbers and parse from strings.
https://github.com/cleancocoa/version
Last synced: 4 months ago
JSON representation
Swift µ-library to express semantic version numbers and parse from strings.
- Host: GitHub
- URL: https://github.com/cleancocoa/version
- Owner: CleanCocoa
- License: mit
- Created: 2020-07-18T10:15:31.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-15T10:09:03.000Z (over 1 year ago)
- Last Synced: 2025-04-05T08:35:10.147Z (about 1 year ago)
- Language: Swift
- Size: 9.77 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Version
Swift µ-library to represent (semantic) Versions in code, including parsing from String.
## Usage
```swift
import Version
let version = Version(2, 3, 4)
print(version) // => "2.3.4"
let update = Version(fromString: "2.3.5")
print(update.major) // => "2"
print(update.minor) // => "3"
print(update.patch) // => "5"
```
## Alternatives
- : More features! It comes with conveniences to get versions from `NSBundle` and `UIDevice`; allows appending `prerelease` and `build` attributes to represent e.g. `"1.2.3-alpha.1+B001"`.
## License
Copyright © 2020 Christian Tietze. All rights reserved. Distributed under the MIT License.