Skip to content

Commit

Permalink
update for Swift1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nghialv committed Apr 13, 2015
1 parent d297a54 commit fb7a0e7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Transporter/TPExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
import UIKit

extension UIDevice {
private class var osVersion: NSString {
private class var osVersion: String {
return UIDevice.currentDevice().systemVersion
}

class func systemVersionEqualTo(version: NSString) -> Bool {
class func systemVersionEqualTo(version: String) -> Bool {
return osVersion.compare(version, options: NSStringCompareOptions.NumericSearch) == NSComparisonResult.OrderedSame
}

class func systemVersionGreaterThan(version: NSString) -> Bool {
class func systemVersionGreaterThan(version: String) -> Bool {
return osVersion.compare(version, options: NSStringCompareOptions.NumericSearch) == NSComparisonResult.OrderedDescending
}

class func systemVersionGreaterThanOrEqualTo(version: NSString) -> Bool {
class func systemVersionGreaterThanOrEqualTo(version: String) -> Bool {
return osVersion.compare(version, options: NSStringCompareOptions.NumericSearch) != NSComparisonResult.OrderedAscending
}

class func systemVersionLessThan(version: NSString) -> Bool {
class func systemVersionLessThan(version: String) -> Bool {
return osVersion.compare(version, options: NSStringCompareOptions.NumericSearch) == NSComparisonResult.OrderedAscending
}

class func systemVersionLessThanOrEqualTo(version: NSString) -> Bool {
class func systemVersionLessThanOrEqualTo(version: String) -> Bool {
return osVersion.compare(version, options: NSStringCompareOptions.NumericSearch) != NSComparisonResult.OrderedDescending
}
}

0 comments on commit fb7a0e7

Please sign in to comment.