Instance Method

pathForImageResource(_:)

Returns the location of the specified image resource file.

Declaration

func pathForImageResource(_ name: NSImage.Name) -> String?

Parameters

name

The name of the image resource file, without any pathname information. Including a filename extension is optional.

Return Value

The absolute pathname of the resource file or nil if the file is not found.

Discussion

Image resources are those files in the bundle that are recognized by the NSImage class, including those that can be converted using the Image IO framework.

See Also

Finding Image Resources

func urlForImageResource(NSImage.Name)

Returns the location of the specified image resource as an NSURL.

func image(forResource: NSImage.Name)

Returns an NSImage instance associated with the specified name, which can be backed by multiple files representing different resolution versions of the image.