duduah / MarvelKit

A Swift SDK for working with the Marvel API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MarvelKit

Swift 3 Carthage compatible Build Status

A Swift SDK for working with the https://developer.marvel.com/ API.

Usage

let marvelKitClient = MarvelKitClient(privateKey: "abcd", publicKey: "1234")

func performRequest() {
    marvelKitClient
        .request(MarvelKit.Comic)
        .withParameters([.dateRange(Date(timeIntervalSinceReferenceDate: 0), Date()), .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.

About

A Swift SDK for working with the Marvel API.


Languages

Language:Swift 99.7%Language:Objective-C 0.3%