text: /*
   * This file is part of the SDWebImage package.
   * (c) Olivier Poitrey <rs@dailymotion.com>
   *
   * For the full copyright and license information, please view the LICENSE
   * file that was distributed with this source code.
   */
  
  #import "SDWebImageCompat.h"
  #import "SDWebImageOperation.h"
  
  /**
   These methods are used to support canceling for UIView image loading, it's designed to be used internal but not external.
   All the stored operations are weak, so it will be dalloced after image loading finished. If you need to store operations, use your own class to keep a strong reference for them.
   */
  @interface UIView (WebCacheOperation)
  
  /** 根据 key 找到对应的操作
   *  Get the image load operation for key
   *
   *  @param key key for identifying the operations
   *  @return the image load operation
   */
  - (nullable id<SDWebImageOperation>)sd_imageLoadOperationForKey:(nullable NSString *)key;
  
  /**
   *  Set the image load operation (storage in a UIView based weak map table)
   *  根据 key 设置图像加载操作（存储在 和 UIView 做绑定的字典里面）
   *  @param operation the operation
   *  @param key       key for storing the operation
   */
  - (void)sd_setImageLoadOperation:(nullable id<SDWebImageOperation>)operation forKey:(nullable NSString *)key;
  
  /**
   *  Cancel all operations for the current UIView and key
   *  用这个key找到当前UIView上面的所有操作并取消
   *  @param key key for identifying the operations
   */
  - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key;
  
  /** 只需要移除与当前UIView和key相对应的操作而不取消它们
   *  Just remove the operations corresponding to the current UIView and key without cancelling them
   *
   *  @param key key for identifying the operations
   */
  - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key;
  
  @end
  