nashysolutions/versioning
**Versioning** is a lightweight, modern Swift library for working with [semantic versioning](https://semver.org/).
Features
- β
Intuitive
SemanticVersiontype - βοΈ Initialisers for integers, strings, and string literals
- π Safe comparisons with automatic version normalisation
- π¦ Codable, Comparable, Hashable, Sendable
- π§ͺ Fully testable and platform-agnostic
π¦ Installation
Add this package via Swift Package Manager:
.product(name: "Versioning", package: "versioning")Usage
You can construct a version using individual components:
let version = SemanticVersion(major: 2, minor: 1, patch: 4)Or string literals.
let a: SemanticVersion = "1"
let b: SemanticVersion = "1.0"
let c: SemanticVersion = "1.0.0"
// normalised
assert(a == b)
assert(b == c)
assert(a == c)Package Metadata
Repository: nashysolutions/versioning
Default branch: main
README: README.md