AlamofireImage是基于 Alamofire 的网络图片组件库。可实现图片下载、缩放、UIImageView异步加载网络图片等。
示例代码:
import AlamofireImage Alamofire.request(.GET, "https://httpbin.org/image/png") .responseImage { response in debugPrint(response) print(response.request) print(response.response) debugPrint(response.result) if let image = response.result.value { print("image downloaded: \(image)") } }