DropletIconRenderer

Enumeration

enum DropletIconRenderer

Type methods

creatorAvatar(inBundleAt:)

static func creatorAvatar(inBundleAt bundleURL: URL) -> NSImage?

The creator's avatar from an installed bundle, or nil when it ships none. The submission rules require one, so nil here means a bundle that predates the rule or was assembled by hand.

icon(inBundleAt:pixelSize:)

static func icon(inBundleAt bundleURL: URL, pixelSize: CGFloat = 512) -> NSImage?

The icon of an installed .droplet bundle, or nil when it ships none.

A bundle carries its Icon Composer document under Contents/Resources as <Name>.icon, which is a directory. Bundle.url(forResource:) finds it by extension without the caller having to know the name the droplet chose.

render(documentAt:pixelSize:)

static func render(documentAt url: URL, pixelSize: CGFloat = 512) -> NSImage?

Renders the icon document at url at pixelSize points square.

Returns nil when the document cannot be read; the caller shows the placeholder and reports the validation error separately.