diff --git a/.travis.yml b/.travis.yml index fa17d3c..309da0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c osx_image: xcode61 script: - - xctool -project JSONHelper.xcodeproj -scheme JSONHelperiOS build - - xctool -project JSONHelper.xcodeproj -scheme JSONHelperMac build + - xctool -project JSONHelper.xcodeproj -scheme JSONHelper-iOS build + - xctool -project JSONHelper.xcodeproj -scheme JSONHelper-Mac build diff --git a/JSONHelper.xcodeproj/xcshareddata/xcschemes/JSONHelper-iOS.xcscheme b/JSONHelper.xcodeproj/xcshareddata/xcschemes/JSONHelper-iOS.xcscheme index 0bb8f67..a070507 100644 --- a/JSONHelper.xcodeproj/xcshareddata/xcschemes/JSONHelper-iOS.xcscheme +++ b/JSONHelper.xcodeproj/xcshareddata/xcschemes/JSONHelper-iOS.xcscheme @@ -40,7 +40,7 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES" - buildConfiguration = "Debug"> + buildConfiguration = "Release"> diff --git a/JSONHelper/JSONHelper.swift b/JSONHelper/JSONHelper.swift index 165d38b..548e364 100644 --- a/JSONHelper/JSONHelper.swift +++ b/JSONHelper/JSONHelper.swift @@ -42,6 +42,7 @@ infix operator <-- { associativity right precedence 150 } // For optionals. public func <-- (inout property: T?, value: AnyObject?) -> T? { var newValue: T? + "" if let unwrappedValue: AnyObject = value { // We unwrapped the given value successfully, try to convert. if let convertedValue = unwrappedValue as? T { diff --git a/README.md b/README.md index 7de59d0..1a2f97c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Gratipay](https://img.shields.io/gratipay/bsencan91.svg)](https://gratipay.com/bsencan91/) [![Gitter](https://badges.gitter.im/JOIN CHAT.svg)](https://gitter.im/isair/JSONHelper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -Lightning fast JSON deserialization for iOS & OS X written in Swift. Expanded upon the ideas found in [this blog post](http://robots.thoughtbot.com/efficient-json-in-swift-with-functional-concepts-and-generics). +Lightning fast JSON deserialization for iOS & OS X written in Swift. ##Table of Contents @@ -85,7 +85,7 @@ internal struct Movie: Deserializable { init(data: [String: AnyObject]) { name <-- data["name"] - releaseDate <-- (value: data["release_date"], format: "yyyy-MM-dd") // Refer to the next section for more info. + releaseDate <-- (data["release_date"], "yyyy-MM-dd") // Refer to the next section for more info. } } ``` @@ -144,8 +144,8 @@ NSDate deserialization however, requires a format to be provided most of the tim let meetingDate: NSDate? let partyDates: [NSDate]? -meetingDate <-- (value: "2014-09-18", format: "yyyy-MM-dd") -partyDates <-- (value: ["2014-09-19", "2014-09-20"], format: "yyyy-MM-dd") +meetingDate <-- ("2014-09-18", "yyyy-MM-dd") +partyDates <-- (["2014-09-19", "2014-09-20"], "yyyy-MM-dd") let myDayOff: NSDate? myDayOff <-- 1414172803 // You can also use unix timestamps.