From 55257fbc82738083287eaddba5c8c9e84eb7021b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nemann?= Date: Thu, 2 Jun 2016 19:04:18 +0200 Subject: [PATCH] Update README.md --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 7613eaf..a8fae88 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,26 @@ # MarvelKit A Swift SDK for working with the https://developer.marvel.com/ API. + +## Usage + + let client = MarvelKit(privateKey: "abcd", publicKey: "1234") + + func performRequest() { + client + .request(Comic.self) + .withParameters([.DateRange(NSDate(timeIntervalSinceReferenceDate: 0), NSDate()), .Limit(2)]) + .exec(success: onSuccess, error: onError) + } + + func onSuccess(comicDataWrapper: ComicDataWrapper) { + print(comicDataWrapper) + } + + func onError(error: MarvelKitError) { + print(error.description) + } + +## Acknowledgements + +I'm using the MD5 related bits from https://github.com/krzyzanowskim/CryptoSwift by Marcin Krzyżanowski until CommonCrypto works better with Swift. I could have used a Wrapper framework, but i didn't want to introduce a dependency and thought this was a great opportunity to see how MD5 is implemented.