Mint 1.0.0

Mint 1.0.0

Maintained by Meniny.



Mint 1.0.0

Meet Mint

Mint

Author EMail MIT
Version Platforms Swift
Build Passing Cocoapods Carthage SPM

🏵 Introduction

Mint is a hunan readable HTTP request library in Swift.

📋 Requirements

Type Requirement

Platform

iOS

9.0+

macOS

10.11

tvOS

9.0

watchOS

2.0

Linux

N/A

IDE

Xcode

9.3+

Language

Swift

4.1+

📲 Installation

CocoaPods

Mint is available on CocoaPods.

use_frameworks!
pod 'Mint'

Manually

Copy all files in the Mint directory into your project.

🛌 Dependency

N/A

❤️ Contribution

You are welcome to fork and submit pull requests.

🔖 License

Mint is open-sourced software, licensed under the MIT license.

🔫 Usage

import Mint

let mint = Mint.init(baseURL: "https://meniny.cn/api/v2/")

self.mint.get("posts.json") { (result) in
    switch result {
    case .success(let response):
        print(response.dictionaryBody)
    case .failure(let response):
        print(response.error.localizedDescription)
    }
}
import Mint

let downloader = Mint.init(baseURL: "https://meniny.cn/assets/images/")

self.downloader.downloadImage("fire.jpg") { (result) in
    print("Done.")
    switch result {
    case .success(let resp):
        print(resp.image)
    case .failure(let resp):
        print(resp.error.localizedDescription)
    }
}