RSDEmbeddedIconVendor
public protocol RSDEmbeddedIconVendor
RSDEmbeddedIconVendor
is a convenience protocol for fetching an codable image using an optional
RSDImageWrapper
. This protocol implements an extension method to fetch the icon.
-
The optional
RSDImageWrapper
with the pointer to the image.Declaration
Swift
var icon: RSDImageWrapper?
-
fetchIcon(for:callback:)
Extension methodFetch the icon. If
icon
isnil
then this will call the callback method asynchronously on the main thread. Otherwise, it will pass through to the image wrapper to use the image wrapper callback.Declaration
Swift
public func fetchIcon(for size: CGSize, callback: @escaping ((UIImage?) -> Void))
Parameters
size
The size of the image to return.
callback
The callback with the image, run on the main thread.