Latest 1.0.4
Homepage https://github.com/davidrothera/SUPSemVer
License MIT
Platforms ios 8.0, osx 10.9, watchos 2.0, tvos 9.0
Authors

Platform iOS 8+
Platform Mac OS X 10.9+
Platform
Platform

Language Swift 3
Carthage compatible
Build Status
codecov.io
Version
License
Platform

Easy to use framework for comparing semantic versions.

As per the spec for Semantic Versioning versions should be formatted as:

MAJOR.MINOR.PATCH (e.g. 1.0.1)
-or-
MAJOR.MINOR.PATCH-PRERELEASE (e.g. 1.0.1-rc1)

When you have these versions it is hard to compare them to see whether one version is newer than another etc.

Usage

There are a couple of ways that you can use SUPSemVer:

import SUPSemVer

let test1 = SemVer("1.0.1")
let test2 = SemVer("1.0.2-rc1")
let test3 = SemVer(major: 1, minor: 0, patch: 3)
let test4 = SemVer(major: 1, minor: 0, patch: 4, prerelease: "rc1")
let test5 = SemVer(major: 1, minor: 0, patch: 1)

The class implements the Equatable protocol meaning that you can compare one SemVer object to another

test3 > test1   # false
test1 == test5  # true

Installation

SUPSemVer version 1.0.4 required Swift3 which is not backwards compatible with Swift2, if you require Swift2 support please use version 1.0.3

CocoaPods

pod 'SUPSemVer'

Carthage

github "davidrothera/SUPSemVer"

Latest podspec

{
    "name": "SUPSemVer",
    "version": "1.0.4",
    "summary": "Easy-to-use Semantic Version comparison framework",
    "description": "# SUPSemVernnAn easy to use framework for comparing semantic versions.",
    "homepage": "https://github.com/davidrothera/SUPSemVer",
    "license": "MIT",
    "authors": {
        "David Rothera": "[email protected]"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source": {
        "git": "https://github.com/davidrothera/SUPSemVer.git",
        "tag": "1.0.4"
    },
    "source_files": "SUPSemVer"
}

Pin It on Pinterest

Share This