Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ishkawa committed Feb 18, 2015
1 parent a982800 commit 64297f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ protocol set for building type safe web API client in Swift.
## Example

```swift
let request = GitHub.Request.SearchRepositories(query: "APIKit")
// parameters of request are validated by type system of Swift
let request = GitHub.Request.SearchRepositories(query: "APIKit", sort: .Stars)

GitHub.sendRequest(request) { response in
// no optional bindings are required to get response and error (thanks to LlamaKit.Result)
switch response {
case .Success(let box):
self.repositories = box.unbox // type of response object is inferred by request
// type of response is inferred from type of request
self.repositories = box.unbox
self.tableView?.reloadData()

case .Failure(let box):
Expand Down

0 comments on commit 64297f6

Please sign in to comment.