GPKGIconCache

Objective-C

@interface GPKGIconCache : NSObject

Swift

class GPKGIconCache : NSObject

Icon Cache of icon images

  • Screen scale, default is 1.0

    Declaration

    Objective-C

    @property (nonatomic) float scale;

    Swift

    var scale: Float { get set }
  • Initialize, created with cache size of DEFAULT_ICON_CACHE_SIZE

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()

    Return Value

    new icon cache

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithSize:(int)size;

    Swift

    init!(size: Int32)

    Parameters

    size

    max icon images to retain in the cache

    Return Value

    new icon cache

  • Get the cached image for the icon row or nil if not cached

    Declaration

    Objective-C

    - (id)imageForRow:(GPKGIconRow *)iconRow;

    Swift

    func image(for iconRow: GPKGIconRow!) -> Any!

    Parameters

    iconRow

    icon row

    Return Value

    icon image or nil

  • Get the cached image for the icon row id or nil if not cached

    Declaration

    Objective-C

    - (id)imageForId:(int)iconRowId;

    Swift

    func image(forId iconRowId: Int32) -> Any!

    Parameters

    iconRowId

    icon row id

    Return Value

    icon image or nil

  • Get the cached image for the icon row id or nil if not cached

    Declaration

    Objective-C

    - (id)imageForIdNumber:(NSNumber *)iconRowId;

    Swift

    func image(forIdNumber iconRowId: NSNumber!) -> Any!

    Parameters

    iconRowId

    icon row id

    Return Value

    icon image or nil

  • Cache the icon image for the icon row

    Declaration

    Objective-C

    - (id)putImage:(id)image forRow:(GPKGIconRow *)iconRow;

    Swift

    func putImage(_ image: Any!, for iconRow: GPKGIconRow!) -> Any!

    Parameters

    image

    icon image

    iconRow

    icon row

    Return Value

    previous cached icon image or nil

  • Cache the icon image for the icon row id

    Declaration

    Objective-C

    - (id)putImage:(id)image forId:(int)iconRowId;

    Swift

    func putImage(_ image: Any!, forId iconRowId: Int32) -> Any!

    Parameters

    image

    icon image

    iconRowId

    icon row id

    Return Value

    previous cached icon image or nil

  • Cache the icon image for the icon row id

    Declaration

    Objective-C

    - (id)putImage:(id)image forIdNumber:(NSNumber *)iconRowId;

    Swift

    func putImage(_ image: Any!, forIdNumber iconRowId: NSNumber!) -> Any!

    Parameters

    image

    icon image

    iconRowId

    icon row id

    Return Value

    previous cached icon image or nil

  • Remove the cached image for the icon row

    Declaration

    Objective-C

    - (id)removeForRow:(GPKGIconRow *)iconRow;

    Swift

    func remove(for iconRow: GPKGIconRow!) -> Any!

    Parameters

    iconRow

    icon row

    Return Value

    removed icon image or nil

  • Remove the cached image for the icon row id

    Declaration

    Objective-C

    - (id)removeForId:(int)iconRowId;

    Swift

    func remove(forId iconRowId: Int32) -> Any!

    Parameters

    iconRowId

    icon row id

    Return Value

    removed icon image or nil

  • Remove the cached image for the icon row id

    Declaration

    Objective-C

    - (id)removeForIdNumber:(NSNumber *)iconRowId;

    Swift

    func remove(forIdNumber iconRowId: NSNumber!) -> Any!

    Parameters

    iconRowId

    icon row id

    Return Value

    removed icon image or nil

  • Clear the cache

    Declaration

    Objective-C

    - (void)clear;

    Swift

    func clear()
  • Resize the cache

    Declaration

    Objective-C

    - (void)resizeWithSize:(int)maxSize;

    Swift

    func resize(withSize maxSize: Int32)

    Parameters

    maxSize

    max size

  • Create or retrieve from cache an icon image for the icon row

    Declaration

    Objective-C

    - (id)createIconForRow:(GPKGIconRow *)icon;

    Swift

    func createIcon(for icon: GPKGIconRow!) -> Any!

    Parameters

    icon

    icon row

    Return Value

    icon image

  • Create an icon image for the icon row without caching

    Declaration

    Objective-C

    + (id)createIconNoCacheForRow:(GPKGIconRow *)icon;

    Swift

    class func createIconNoCache(for icon: GPKGIconRow!) -> Any!

    Parameters

    icon

    icon row

    Return Value

    icon image

  • Create or retrieve from cache an icon image for the icon row

    Declaration

    Objective-C

    + (id)createIconForRow:(GPKGIconRow *)icon fromCache:(GPKGIconCache *)iconCache;

    Swift

    class func createIcon(for icon: GPKGIconRow!, from iconCache: GPKGIconCache!) -> Any!

    Parameters

    icon

    icon row

    iconCache

    icon cache

    Return Value

    icon image