Skip to content

Commit

Permalink
Merge branch 'master' of github.com:isair/JSONHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
Baris Sencan committed Apr 13, 2015
2 parents b6d4c65 + 40d1d9a commit f52f3e5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
buildConfiguration = "Release">
<Testables>
<TestableReference
skipped = "NO">
Expand Down
1 change: 1 addition & 0 deletions JSONHelper/JSONHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ infix operator <-- { associativity right precedence 150 }
// For optionals.
public func <-- <T>(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 {
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 &amp; 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 &amp; OS X written in Swift.

##Table of Contents

Expand Down Expand Up @@ -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.
}
}
```
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit f52f3e5

Please sign in to comment.