2
0

SDImageAssetManager.h 1.0 KB

1234567891011121314151617181920212223
  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 <Foundation/Foundation.h>
  9. #import "SDWebImageCompat.h"
  10. /// A Image-Asset manager to work like UIKit/AppKit's image cache behavior
  11. /// Apple parse the Asset Catalog compiled file(`Assets.car`) by CoreUI.framework, however it's a private framework and there are no other ways to directly get the data. So we just process the normal bundle files :)
  12. @interface SDImageAssetManager : NSObject
  13. @property (nonatomic, strong, nonnull) NSMapTable<NSString *, UIImage *> *imageTable;
  14. + (nonnull instancetype)sharedAssetManager;
  15. - (nullable NSString *)getPathForName:(nonnull NSString *)name bundle:(nonnull NSBundle *)bundle preferredScale:(nonnull CGFloat *)scale;
  16. - (nullable UIImage *)imageForName:(nonnull NSString *)name;
  17. - (void)storeImage:(nonnull UIImage *)image forName:(nonnull NSString *)name;
  18. @end