Skip to content

Commit

Permalink
Updates README
Browse files Browse the repository at this point in the history
  • Loading branch information
s4cha committed Apr 17, 2016
1 parent 3612d36 commit b2017dc
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,34 @@ createdAt <-- json["created_at"]?.dateFormat("yyyy-MM-dd'T'HH:mm:ssZZZZZ")
```
Just provide it on a case per case basis ! 🎉

## Accessing JSON values

### Nested values

```swift
value <-- json["nested.nested.nested.nestedValue"]
```

### Object at index
```swift
value <-- json[12]
```

### Combine both
```swift
value <-- json[1]?["someKey"]?[2]?["something.other"]
```

### Looping on Array
```swift
if let collection = json.collection {
for jsonEntry in collection {
//Do something
}
}
```


## Acknoledgments
This wouldn't exist without [YannickDot](https://github.com/YannickDot), [Damien-nd](https://github.com/damien-nd) and [maxkonovalov](https://github.com/maxkonovalov)

Expand Down

0 comments on commit b2017dc

Please sign in to comment.