Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
12345678910111213141516171819202122import AppKit
@MainActorfinal class AppIconImages { private var images: [String: NSImage] = [:] private let bundle: Bundle
init(bundle: Bundle = .module) { self.bundle = bundle }
func image(for choice: AppIconChoice, appearance: AppIconAppearance) throws -> NSImage { let name = choice.resourceName(appearance: appearance) if let image = images[name] { return image } guard let url = bundle.url(forResource: name, withExtension: "png"), let image = NSImage(contentsOf: url), image.isValid else { throw AppIconFailure.missingImage(name) } images[name] = image return image }}