ViewBitmapCache

public class ViewBitmapCache

Utility class used to cache view bitmaps. Used primarily by ControlView

  • Controls the maximum size the cached bitmap can have before it can no longer be cached, resulting in further cacheOrRender operations always live rendering the content, as if caching was disabled.

    Caching behaviour resumes once the cached bitmap size shrinks to less than this value.

    When setting, if the currently cached bitmap exceeds these dimensions, the cache is invalidated.

    Declaration

    Swift

    public var maximumCachedBitmapSize: UIIntSize { get set }
  • Controls whether bitmap caching is currently enabled. Setting this value to false invalidates the current cached image and releases its memory contents.

    Declaration

    Swift

    public var isCachingEnabled: Bool { get set }
  • The scale of the internal bitmap used for caching. Values different than 1 produce bitmap caches that are that fraction of the size of the cached contents.

    This invalidates the cache and requires a redraw to refresh.

    Declaration

    Swift

    public var scale: UIVector { get set }
  • Undocumented

    Declaration

    Swift

    public init(isCachingEnabled: Bool)
  • Requests that the size of the cached bitmap bounds be updated to a specified value.

    This invalidates the cache and requires a redraw to refresh.

    Declaration

    Swift

    public func updateBitmapBounds(_ bounds: UIRectangle)
  • Invalidates the cache by releasing the memory associated with its current cached image.

    Declaration

    Swift

    public func invalidateCache()
  • Performs a deferred rendering operation that either redraws the cache bitmap if it’s been invalidated through closure and then draws it on renderer, or if a cached bitmap is already present, draws the cached bitmap to renderer and skips invoking closure.

    Declaration

    Swift

    public func cachingOrRendering(_ renderer: Renderer, _ closure: (Renderer) -> Void)