AlamofireImage是基于 Alamofire 的網(wǎng)絡(luò)圖片組件庫(kù)??蓪?shí)現(xiàn)圖片下載、縮放、UIImageView異步加載網(wǎng)絡(luò)圖片等。
示例代碼:
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)") } }