An NSAppearance object represents a file that specifies a standard 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.


If the art for a specific view can’t be found, AppKit searches for the art in the appearances of the view’s ancestors. A nil appearance means that a view uses the default Aqua appearance; a non-nil appearance means that the view uses an ancestor’s appearance.

When AppKit draws a control, it automatically sets the current appearance on the current thread to the control’s appearance. The current appearance can influence the actual drawing path and the return values you get when you access system fonts and colors. The current appearance also affects the appearance of text and images, such as the text and template images that can be displayed in a toolbar.


Creating an Appearance

init?(appearanceNamed: String, bundle: Bundle?)

Creates an NSAppearance object initialized to the specified named appearance in the specified bundle.

Getting the Appearance Name

var name: String

The name of the appearance.

Getting an Appearance

init?(named: String)

Returns the NSAppearance object with the specified name.

Getting and Setting the Current Appearance

class func current()

Returns the NSAppearance object that’s set on the current thread.

class func setCurrent(NSAppearance?)

Sets the current appearance to the specified NSAppearance object.

Managing Vibrancy

var allowsVibrancy: Bool

Specifies whether the current appearance allows vibrancy.


Standard Appearances

These strings are used to specify standard appearances provided by macOS.


Inherits From