How do you get standard Mac OS X icons to use in your design / app?
By standard icons I mean toolbar icons from this screenshots:
Is there a location where
Other images/icons are available from IconServices
:
/*
Type of the predefined/generic icons. For example, the call:
err = GetIconRef(kOnSystemDisk, kSystemIconsCreator, kHelpIcon, &iconRef);
will retun in iconRef the IconRef for the standard help icon.
*/
/* Generic Finder icons */
public var kClipboardIcon: Int { get }
public var kClippingUnknownTypeIcon: Int { get }
public var kClippingPictureTypeIcon: Int { get }
public var kClippingTextTypeIcon: Int { get }
public var kClippingSoundTypeIcon: Int { get }
public var kDesktopIcon: Int { get }
public var kFinderIcon: Int { get }
public var kComputerIcon: Int { get }
public var kFontSuitcaseIcon: Int { get }
public var kFullTrashIcon: Int { get }
public var kGenericApplicationIcon: Int { get }
public var kGenericCDROMIcon: Int { get }
...
...
You can use NSWorkspace icon methods with the above constants:
NSWorkspace.shared.icon(forFileType: NSFileTypeForHFSTypeCode(UInt32(kGenericApplicationIcon)))
Not all of those are standard. For the ones which are, you use +[NSImage imageNamed:]
with one of the system-defined image name constants, such as NSImageNameGoLeftTemplate
or NSImageNameIconViewTemplate
.
see +[NSImage imageNamed:(NSString)name] and the links in that for the different list of os defined images...
eg.
NSImage * img = [NSImage imageNamed:NSImageNameFolder];
toolbar images specifically are listed:
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSImage_Class/index.html#//apple_ref/doc/constant_group/Toolbar_Named_Images