Skip to content

Wrapper script for Marvel Api. Get all the informations about Marvel with ease.

License

Notifications You must be signed in to change notification settings

tdle94/MarvelApiWrapper

Repository files navigation

MarvelApiWrapper

CI Status Version License Platform

About

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

Motivation

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.

Usage

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
}

Installation

MarvelApiWrapper is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MarvelApiWrapper'

Author

tdle94, tuyendle92

License

MarvelApiWrapper is available under the MIT license. See the LICENSE file for more info.