Swiftpack.co - alexanderwe/SemanticVersioningKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by alexanderwe.
alexanderwe/SemanticVersioningKit v2.1.0
Small library to create and parse Semantic Versioning conforming representations.
⭐️ 2
🕓 1 week ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/alexanderwe/SemanticVersioningKit.git", from: "v2.1.0")


Swift 5.0 SPM CI

SemanticVersioningKit is a small library to create and parse Semantic Versioning conforming representations.


Swift Package Manager

To integrate using Apple's Swift Package Manager, add the following as a dependency to your Package.swift:

dependencies: [
    .package(url: "https://github.com/alexanderwe/SemanticVersioningKit.git", from: "1.0.0")

Alternatively navigate to your Xcode project, select Swift Packages and click the + icon to search for SemanticVersioningKit.


If you prefer not to use any of the aforementioned dependency managers, you can integrate SemanticVersioningKit into your project manually. Simply drag the Sources Folder into your Xcode project.


At first import SemanticVersioningKit

import SemanticVersioningKit

Define a SemanticVersion instance

let version = SemanticVersion(major: 1, minor: 0, patch: 0) // "1.0.0"
let versionWithAdditions = SemanticVersion(major: 1, minor: 0, patch: 0, preReleaseIdentifiers: ["alpha", "1"], buildIdentifiers: ["exp","sha","5114f85"]) // "1.0.0-alpha.1+exp.sha.5114f85"

It is also possible to create a SemanticVersion from a String representation. Just be aware that the initialization can fail due to the used String not conforming to the Semantic Versioning format. Therefore an optional SemanticVersion is returned in those cases.

let version = try SemanticVersion(input: "1.0.0")
let failed = try SemanticVersion(input: ".0.0")


Contributions are very welcome 🙌


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

Release Notes

1 week ago

What's Changed

Full Changelog: https://github.com/alexanderwe/SemanticVersioningKit/compare/v2.0.0...v2.1.0

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