ImageCache
final class ImageCache
Shared class with a memory cache of images from songs
-
The shared instance of the class
Declaration
Swift
nonisolated(unsafe) static let shared = ImageCache()
-
The image cache
Declaration
Swift
var imageCache: NSCache<NSURL, NSImage> = .init()
-
Set an image ro the cache
Declaration
Swift
func setImageCache(image: NSImage, key: URL)
-
Get a image from the cache
Declaration
Swift
func getImageFromCache(from key: URL) -> NSImage?
-
Private init to make sure only the shared instance is used
Declaration
Swift
private init()