Latest 2.8.1
Homepage https://github.com/jovito-royeca/ManaKit
License MIT
Platforms ios 9.0
Dependencies Sync, Kanna, PromiseKit, SSZipArchive, SDWebImage
Frameworks UIKit, MapKit, Sync, Kanna, PromiseKit, SSZipArchive, SDWebImage
Authors

CI Status
Version
License
Platform

A Core Data implementation of MTGJSON.

Usage

The singleton ManaKit class provides API methods for setting up the Core Data database, getting images embedded in the framework, and a lot more.

Set up ManaKit in your app delegate class:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    // Override point for customization after application launch.
    ManaKit.sharedInstance.setupResources()
    ManaKit.sharedInstance.configureTCGPlayer(partnerKey: "Your_Partner_Key", publicKey: nil, privateKey: nil)

    return true
}

To access the Core Data database, you may use the mainContext of ManaKit:

let context = ManaKit.sharedInstance.dataStack!.mainContext

ManaKit also provides methods to get MTG images.

Specific images:

open func imageFromFramework(imageName: ImageName) -> UIImage?

Casting Cost images:

open func manaImages(manaCost: String) -> [[String:UIImage]]

Card image:

open func downloadCardImage(_ card: CMCard, cropImage: Bool, completion: @escaping (_ card: CMCard, _ image: UIImage?, _ croppedImage: UIImage?, _ error: NSError?) -> Void)

TCG Player Hi-Mid-Low Pricing API.

open func fetchTCGPlayerPricing(card: CMCard, completion: @escaping (_ cardPricing: CMCardPricing?, _ error: Error?) -> Void)

Example

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

Installation

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

pod "ManaKit"

Author

Jovito Royeca
[email protected]

License

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

Latest podspec

{
    "name": "ManaKit",
    "version": "2.8.1",
    "summary": "Core Data implementation of MTGJSON.com.",
    "description": "A database of Magic: The Gathering cards. Includes prices and images.",
    "homepage": "https://github.com/jovito-royeca/ManaKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "jovito-royeca": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jovito-royeca/ManaKit.git",
        "tag": "2.8.1"
    },
    "social_media_url": "https://twitter.com/ManaGuideApp",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "ManaKit/Classes/**/*",
    "resource_bundles": {
        "ManaKit": [
            "ManaKit/Assets/**/*"
        ]
    },
    "pod_target_xcconfig": {
        "HEADER_SEARCH_PATHS": "$(SDKROOT)/usr/include/libxml2"
    },
    "frameworks": [
        "UIKit",
        "MapKit",
        "Sync",
        "Kanna",
        "PromiseKit",
        "SSZipArchive",
        "SDWebImage"
    ],
    "dependencies": {
        "Sync": [],
        "Kanna": [
            "~> 3"
        ],
        "PromiseKit": [],
        "SSZipArchive": [],
        "SDWebImage": []
    }
}

Pin It on Pinterest

Share This