Mint 1.0.0

Mint 1.0.0

Meniny 管理。



Mint 1.0.0

认识 Mint

Mint

Author EMail MIT
Version Platforms Swift
Build Passing Cocoapods Carthage SPM

🏵简介

Mint 是一个用 Swift 编写的易于阅读的 HTTP 请求库。

📋要求

类型 需求

平台

iOS

9.0+

macOS

10.11

tvOS

9.0

watchOS

2.0

Linux

未提供

IDE

Xcode

9.3+

语言

Swift

4.1+

📲安装

CocoaPods

Mint可在 CocoaPods 上找到。

use_frameworks!
pod 'Mint'

手动

Mint 目录下的所有文件复制到您的项目中。

🛌依赖关系

未提供

❤️贡献

欢迎您克隆并提交拉取请求。

🔖许可证

Mint 是开源软件,受 MIT 许可证的许可。

🔫使用方法

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)
    }
}