From 64297f6f70fd59b622008382be84aadaa46f4d18 Mon Sep 17 00:00:00 2001 From: Yosuke Ishikawa Date: Thu, 19 Feb 2015 01:31:03 +0900 Subject: [PATCH] update README --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50c86782..d8fc5789 100644 --- a/README.md +++ b/README.md @@ -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):