KeyedViewBitmapCache
public class KeyedViewBitmapCache : ViewBitmapCache
A specialization of ViewBitmapCache that supports storing hashable metadata
that can be used to invalidate the contents of the cache by comparing the
current values with the values present the previous time the cache was rendered.
-
Updates the key for this bitmap cache to be a ordered-set of the given hashable values.
The next time
cachingOrRenderingis invoked, if the contents of the latestupdateKeysup to before the method is invoked is different from the contents of the last timecachingOrRenderingwas invoked, the bitmap cache is invalidated and is re-rendered.Declaration
Swift
public func updateKeys(_ keys: AnyHashable...) -
Performs a deferred rendering operation that either redraws the cache bitmap if it’s been invalidated through
closureand then draws it onrenderer, or if a cached bitmap is already present, draws the cached bitmap torendererand skips invokingclosure.If the latest
updateKeysinvocation does not match the keys present when the lastcachingOrRenderingcall was made, the contents of the cache are erased and re-rendered.Declaration
Swift
public override func cachingOrRendering( _ renderer: any Renderer, _ closure: (any Renderer) -> Void )