UIImageView+HighlightedWebCache.h 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * This file is part of the SDWebImage package.
  3. * (c) Olivier Poitrey <rs@dailymotion.com>
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. #import "SDWebImageCompat.h"
  9. #if SD_UIKIT
  10. #import "SDWebImageManager.h"
  11. /**
  12. * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state.
  13. */
  14. @interface UIImageView (HighlightedWebCache)
  15. /**
  16. * Set the imageView `highlightedImage` with an `url`.
  17. *
  18. * The download is asynchronous and cached.
  19. *
  20. * @param url The url for the image.
  21. */
  22. - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT;
  23. /**
  24. * Set the imageView `highlightedImage` with an `url` and custom options.
  25. *
  26. * The download is asynchronous and cached.
  27. *
  28. * @param url The url for the image.
  29. * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
  30. */
  31. - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
  32. options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
  33. /**
  34. * Set the imageView `highlightedImage` with an `url`.
  35. *
  36. * The download is asynchronous and cached.
  37. *
  38. * @param url The url for the image.
  39. * @param completedBlock A block called when operation has been completed. This block has no return value
  40. * and takes the requested UIImage as first parameter. In case of error the image parameter
  41. * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
  42. * indicating if the image was retrieved from the local cache or from the network.
  43. * The fourth parameter is the original image url.
  44. */
  45. - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
  46. completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
  47. /**
  48. * Set the imageView `highlightedImage` with an `url` and custom options.
  49. *
  50. * The download is asynchronous and cached.
  51. *
  52. * @param url The url for the image.
  53. * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
  54. * @param completedBlock A block called when operation has been completed. This block has no return value
  55. * and takes the requested UIImage as first parameter. In case of error the image parameter
  56. * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
  57. * indicating if the image was retrieved from the local cache or from the network.
  58. * The fourth parameter is the original image url.
  59. */
  60. - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
  61. options:(SDWebImageOptions)options
  62. completed:(nullable SDExternalCompletionBlock)completedBlock;
  63. /**
  64. * Set the imageView `highlightedImage` with an `url` and custom options.
  65. *
  66. * The download is asynchronous and cached.
  67. *
  68. * @param url The url for the image.
  69. * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
  70. * @param progressBlock A block called while image is downloading
  71. * @note the progress block is executed on a background queue
  72. * @param completedBlock A block called when operation has been completed. This block has no return value
  73. * and takes the requested UIImage as first parameter. In case of error the image parameter
  74. * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
  75. * indicating if the image was retrieved from the local cache or from the network.
  76. * The fourth parameter is the original image url.
  77. */
  78. - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
  79. options:(SDWebImageOptions)options
  80. progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
  81. completed:(nullable SDExternalCompletionBlock)completedBlock;
  82. @end
  83. #endif