Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

SwiftyVersion

License: MIT Build Status

A simpler way to manage Versions in Swift

Initialization

Using the default separator (which is a single point)

let myVersion = Version("1.5.2")

Or using a different separator

let myVersion = Version("1-5-1", usingSeparator: "-")

Logic Operator

Version supports the ==, >, <, <=, and >= operators

Example

let myVersion1 = Version("1-5-2", usingSeparator: "-")
let myVersion2 = Version("1.5.2.1")

print(myVersion1 == myVersion2) // "false"
print(myVersion1 > myVersion2)  // "false"
print(myVersion1 >= myVersion2) // "false"
print(myVersion1 < myVersion2)  // "true"
print(myVersion1 <= myVersion2) // "true"

Installation

Cocoapods

To integrate SwiftyVersion into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'SwiftyVersion', '~> 0.2.1'
end

About

A simpler way to manage Versions in Swift

Resources

License

Packages

No packages published