Latest 0.0.6
Homepage https://github.com/guhungry/ios-version
License MIT
Platforms ios 8.0
Dependencies WCExtensions
Authors

iOS Version

Build Status
codecov
LICENSE
Platform compatible

Simple version number compare in major(.minor)?(.patch)? format

Supports compare using ==, !=, >, >=, < and <=

Download

Install using CocoaPods, add dependency in Podfile:

pod 'WCVersion', '~> 0.0.0'

CocoaPods compatible

Examples

Import

import WCVersion

Initialize

let version1 = VersionNumber("5")
let version2 = VersionNumber("3.8")
let version3 = VersionNumber("1.2.3")

Comparing

VersionNumber("1.2.3") > VersionNumber("1.5.3")
false

VersionNumber("1.2.3") < VersionNumber("1.5.3")
true

VersionNumber("1.2.3") == VersionNumber("1.5.3")
false

VersionNumber("4.1.7") < VersionNumber("2.5.2")
false

VersionNumber("4.1.7") > VersionNumber("2.5.2")
true

VersionNumber("4.1.7") == VersionNumber("2.5.2")
false

VersionNumber("9.1.2") < VersionNumber("9.1.5")
true

VersionNumber("9.1.2") > VersionNumber("9.1.5")
false

VersionNumber("9.1.2") == VersionNumber("9.1.5")
false

VersionNumber("2.3.1") > VersionNumber("2.3.1")
false

VersionNumber("2.3.1") < VersionNumber("2.3.1")
false

VersionNumber("2.3.1") == VersionNumber("2.3.1")
true

Latest podspec

{
    "name": "WCVersion",
    "version": "0.0.6",
    "summary": "Simple version number compare in major(.minor)?(.patch)? format",
    "description": "Simple version number compare in major(.minor)?(.patch)? formatnnSupports compare using ==, !=, >, >=, < and <=",
    "homepage": "https://github.com/guhungry/ios-version",
    "license": "MIT",
    "authors": {
        "Woraphot Chokratanasombat": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/guhungry/ios-version.git",
        "tag": "0.0.6"
    },
    "source_files": "WCVersion/**/*.swift",
    "dependencies": {
        "WCExtensions": [
            "~> 0.0.5"
        ]
    },
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This