How can we leverage NSAppearance?
Posted
by
Brad Allred
on Stack Overflow
See other posts from Stack Overflow
or by Brad Allred
Published on 2013-11-05T01:40:36Z
Indexed on
2013/11/05
3:54 UTC
Read the original article
Hit count: 755
I was reading the Cocoa documentation and stumbled across some new features in the 10.9 API.
From the docs I gather that the NSAppearance
class and a related protocol NSAppearanceCustomization
Appear to be a means of customizing the appearance of NSView
and its descendants.
An NSAppearance object represents a file that specifies a standard or custom appearance that applies to a subset of UI elements in an app. An app can contain multiple appearance files and—because NSAppearance conforms to NSCoding—you can use Interface Builder to assign UI elements to an appearance.
Typically, you customize a window by using Xcode to create an appearance file that contains the views you want to customize and the custom art that should be applied to them. Xcode transforms the file’s art content into a runtime format that AppKit can draw when the specified views are displayed.
Well that all sounds neat and promising, but nowhere in the documentation can I find what an appearance file is or how to make one. Google searches are coming up empty other than for the thin documentation I have already read.
I do see that UIKit has a similar sounding UIAppearance
class, but from what I can tell this is not a straight port of the UIKit class.
Does anybody know how to make this magic "appearance file" and what exactly we can do with it?
© Stack Overflow or respective owner