Skip to content

Commit 55257fb

Browse files
committed
Update README.md
1 parent 29e1e2a commit 55257fb

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
11
# MarvelKit
22

33
A Swift SDK for working with the https://developer.marvel.com/ API.
4+
5+
## Usage
6+
7+
let client = MarvelKit(privateKey: "abcd", publicKey: "1234")
8+
9+
func performRequest() {
10+
client
11+
.request(Comic.self)
12+
.withParameters([.DateRange(NSDate(timeIntervalSinceReferenceDate: 0), NSDate()), .Limit(2)])
13+
.exec(success: onSuccess, error: onError)
14+
}
15+
16+
func onSuccess(comicDataWrapper: ComicDataWrapper) {
17+
print(comicDataWrapper)
18+
}
19+
20+
func onError(error: MarvelKitError) {
21+
print(error.description)
22+
}
23+
24+
## Acknowledgements
25+
26+
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.

0 commit comments

Comments
 (0)