Swiftpack.co - kutchie-pelaez/Semver as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by kutchie-pelaez.
kutchie-pelaez/Semver v1.0.0
Swift implementation of the Semantic Versioning.
⭐️ 0
🕓 4 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/kutchie-pelaez/Semver.git", from: "v1.0.0")


Swift implementation of the Semantic Versioning.


import Semver

let version = Semver(1, 0, 0)
let versionWithPreReleaseAndBuild = try Semver(
    1, 0, 0,
    preRelease: "alpha",
    build: "build"
let versionFromString = try Semver("1.0.0-alpha+build")

Semver conforms to CustomStringConvertible, Comparable, Hashable and Codable:

/// version1 < version2 < version3 < version4
let version1 = try Semver("0.0.0")
let version2 = try Semver("1.0.0-alpha")
let version3 = try Semver("1.0.0")
let version4 = try Semver("2.0.0")

/// version == versionWithBuild
/// version.hashValue == versionWithBuild.hashValue
let version = try Semver("1.0.0")
let versionWithBuild = try Semver("1.0.0+build")


Swift Package Manager

dependencies: [
    .package(url: "https://github.com/kutchie-pelaez/Semver.git", .upToNextMajor(from: "1.0.0"))


Semver is released under the MIT license. See LICENSE for details.


Stars: 0
Last commit: 4 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

4 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics