Skip to content

Commit

Permalink
prep for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Dahan committed Jan 24, 2016
1 parent 29d91ce commit c8c400b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 119 deletions.
24 changes: 0 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ Graph is a growing project and will encounter changes throughout its development
* [Relationship](#relationship)
* [Action](#action)
* [Groups](#groups)
* [Probability](#probability)
* [Data Driven](#datadriven)
* [Faceted Search](#facetedsearch)
* [JSON](#json)

<a name="entity"></a>
## Entity
Expand Down Expand Up @@ -259,28 +257,6 @@ let collection: Array<Action> = graph.searchForAction(types: ["Purchased"]).filt
}
```

<a name="json"></a>
## JSON

JSON is a widely used format for serializing data. Graph comes with a JSON toolset. Below are some examples of its usage.

```swift
// Serialize Dictionary.
let data: NSData? = JSON.serialize(["user": ["username": "daniel", "password": "abc123", "token": 123456789]])

// Parse NSData.
let j1: JSON? = JSON.parse(data!)
print(j1?["user"]?["username"]?.asString) // Output: "daniel"

// Stringify.
let stringified: String? = JSON.stringify(j1!)
print(stringified) // Output: "{\"user\":{\"password\":\"abc123\",\"token\":123456789,\"username\":\"daniel\"}}"

// Parse String.
let j2: JSON? = JSON.parse(stringified!)
print(j2?["user"]?["token"]?.asInt) // Output: 123456789
```

## License

Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>. All rights reserved.
Expand Down
95 changes: 0 additions & 95 deletions Tests/JSONTests.swift

This file was deleted.

0 comments on commit c8c400b

Please sign in to comment.