Programmatically get a color from an Asset Catalog in 10.11?

222 Views Asked by At

You can add a color set to an .xcassets file, and you can reference that color in other .xibs, and all of that works in 10.11.

But [NSColor colorNamed:] is 10.13+.

How can one programmatically get an NSColor by name from an .xcassets file in 10.11?

1

There are 1 best solutions below

1
1024jp On BEST ANSWER

Unfortunately, there seems to be no way to get NSColor under 10.12 or earlier. You need to hard-code them somewhere as a fallback for earlier versions.