A Marvel API wrapper for requesting characters, comics, event, stories, series and creators from Marvel Studio. I use this for My Marvel app
get Private and Public key here
Marvel API has many optional parameter for their GET request. This will simplify your API call as you can choose to whether or not to provide optional parameter through Config
struct without having to remember what to provide to your GET request.
You have to get public and private key from Marvel
let privateKey = "replace with your own private key"
let publicKey = "replace with your own public key"
let marvel = MarvelApiWrapper(publicKey: privateKey, privateKey: publicKey)
var config = StoryConfig()
config.limit = 1
marvel.getAllStorieWith(config: config) { data, statusCode, error in
guard let data = data else {
return
}
let json = JSON(data)
// Do something with json data
}
MarvelApiWrapper is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MarvelApiWrapper'
tdle94, tuyendle92
MarvelApiWrapper is available under the MIT license. See the LICENSE file for more info.