Skip to content

Commit

Permalink
Merge pull request #56 from Pluto-tv/master
Browse files Browse the repository at this point in the history
Xcode 7.3 optional support
  • Loading branch information
isair committed Mar 25, 2016
2 parents 33006f0 + 9811b10 commit db1c9a2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions JSONHelper/JSONHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ public func <-- <T>(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?:
Expand All @@ -79,6 +73,12 @@ public func <-- <T>(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
}
Expand Down

0 comments on commit db1c9a2

Please sign in to comment.