How to load image in swift using Alamofire

后端 未结 9 1036
醉话见心
醉话见心 2020-12-13 13:16

I have a collection view controller, which load image Async by URL. (Something like Instegram) I am looking for the best way to implement the part of the loading image. plea

9条回答
  •  生来不讨喜
    2020-12-13 13:48

    I created a Swift version of UIImageView+AFNetworking here : Github.
    You don't have to use AFNetworking (and a bridging header) or Alamofire in your project. Just add the file to your project and use it.


    Example usage:

    myImageView.setImageWithUrl(imageUrl, placeHolderImage: somePlaceHolderImage)
    

提交回复
热议问题