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+ |
Mint
is open-sourced software, licensed under the MIT
license.
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)
}
}