diff --git a/JSONHelper/JSONHelper.swift b/JSONHelper/JSONHelper.swift index 5587f12..561ab39 100644 --- a/JSONHelper/JSONHelper.swift +++ b/JSONHelper/JSONHelper.swift @@ -63,12 +63,6 @@ public func <-- (inout property: T?, value: AnyObject?) -> T? { } else { // Convert by processing the value first. switch property { - case is Int?: - if unwrappedValue is String { - if let intValue = Int("\(unwrappedValue)") { - newValue = intValue as? T - } - } case is NSURL?: newValue = NSURL(string: "\(unwrappedValue)") as? T case is NSDate?: @@ -79,6 +73,12 @@ public func <-- (inout property: T?, value: AnyObject?) -> T? { } else if let timestamp = unwrappedValue as? NSNumber { newValue = NSDate(timeIntervalSince1970: timestamp.doubleValue) as? T } + case is Int?: + if unwrappedValue is String { + if let intValue = Int("\(unwrappedValue)") { + newValue = intValue as? T + } + } default: break }