Get a color from Asset Catalog prior to OS X 10.13

328 Views Asked by At

For applications running on OS X 10.13 or later, you can use [NSColor colorNamed:@"MyColor"] to get a color from an asset catalog. But how can you access these colors in applications meant for older OS versions?

Experiments with +colorWithCatalogName:colorName: do not appear to work, it looks like you can only access system colors that way.

NSColor *someColor = [NSColor colorWithCatalogName:@"Assets.xcassets" colorName:@"FunkyColor"];
NSLog(@"Color: %@", someColor);

This yields "(null)".

Is there a way at all to access Asset Catalog colors pre-10.13?

0

There are 0 best solutions below