ScryfallApiSwift

A Swift wrapper for the Scryfall REST API

MIT License

Stars
2

ScryfallApiSwift

A Swift wrapper for the Scryfall REST API. Allows you to search for cards, sets, symbols, etc. The purpose is to be able to get information about Magic Cards and Magic Sets.

This Library is not affiliated with Magic the Gathering or Scryfall in any way. See https://scryfall.com/docs/api for the Scryfall REST API docs.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Cocoapods (or Swift Package Manager)

Installation

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

pod 'ScryfallApiSwift'

Example Usage

import ScryfallApiSwift

let task = ScryfallApi().randomCard { result in
    switch result {
    case .success(let card):
        print("Got a random card: \(card.name)")
    case .failure(let error):
        print("There was an error: \(error.localizedDescription)")
    }
}

Author

Eric Internicola, [email protected]

License

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