Contents

nashysolutions/versioning

**Versioning** is a lightweight, modern Swift library for working with [semantic versioning](https://semver.org/).

Features

  • βœ… Intuitive SemanticVersion type
  • ✍️ 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