Skip to content

zhwayne/OhMyVersion

Repository files navigation

OhMyVersion

A better way to compare the version level.

Usage

Here's a simple example for comparing two versions.

/* Tips: Press the key [option + 6] to type §. */

let v1 = §"2.3.4"
let v2: Version = "10.2.4"

if v2 > v1 {
    // Do something in a high version
} else {
    // Do other things
}

Enjoy it!

Required

  • Swift 5
  • Xcode 9+
  • iOS 8+

Installation

Cocoapods

pod 'OhMyVersion'

License

All source code is licensed under the MIT License.