【问题标题】:Cancel single image download with Kingfisher使用 Kingfisher 取消单个图像下载
【发布时间】:2018-07-14 08:49:55
【问题描述】:

我正在使用 kingfisher 通过其中一种方法下载单个图像

KingfisherManager.shared.retrieveImage

ImageDownloader.default.downloadImage

我的问题是如何取消当前下载以便开始另一个下载?

我没有 ImageView 所以我不能使用

imageView.kf.cancelDownloadTask()

【问题讨论】:

    标签: ios swift kingfisher


    【解决方案1】:

    这两种方法都分别返回一个任务对象RetrieveImageTaskRetrieveImageDownloadTask。您需要保留返回的任务对象,并在您希望它取消时调用 task.cancel()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-06
      • 2017-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-20
      • 1970-01-01
      相关资源
      最近更新 更多