Class

NSUserInterfaceCompressionOptions

An object that specifies how user interface elements resize themselves when space is constrained.

Declaration

class NSUserInterfaceCompressionOptions : NSObject

Overview

An instance of NSUserInterfaceCompressionOptions contains zero or more options. Because a compression options object behaves like a set, you can use common operations like intersection, union and subtraction to interact with instances and their members.

You can access system-defined options through the class methods detailed in Creating Standard Options, or you can create your own custom options with the init(identifier:) initializer.

To compare two different compression options objects, use the methods described in the Comparing Compression Options section.

Topics

Creating a Compression Option

init()

Creates a compression options object containing no options.

init(options: Set<NSUserInterfaceCompressionOptions>)

Creates an option object that represents the union of the supplied options.

init(identifier: String)

Creates an option object with the given identifier string.

Creating Standard Options

class var hideImages: NSUserInterfaceCompressionOptions

An option specifying that views should hide their images.

class var hideText: NSUserInterfaceCompressionOptions

An option specifying that views should hide their text.

class var reduceMetrics: NSUserInterfaceCompressionOptions

An option specifying that views should reduce their internal metrics.

class var breakEqualWidths: NSUserInterfaceCompressionOptions

An option specifying that views should no longer maintain equal width constraints.

class var standardOptions: NSUserInterfaceCompressionOptions

An option that represents the union of all standard compression options.

Comparing Compression Options

var isEmpty: Bool

A Boolean value that denotes whether the option is empty.

func contains(NSUserInterfaceCompressionOptions) -> Bool

Determines whether the supplied compression options are all present in the current instance.

func intersects(NSUserInterfaceCompressionOptions) -> Bool

Determines whether the supplied compression options intersect with the current instance's options.

Combining Compression Options

func union(NSUserInterfaceCompressionOptions) -> NSUserInterfaceCompressionOptions

Creates a new compression options object representing the union with the provided options.

func subtracting(NSUserInterfaceCompressionOptions) -> NSUserInterfaceCompressionOptions

Creates a new compression options object with the supplied options removed.

Relationships

Inherits From

See Also

Touch Bar Items

class NSTouchBarItem

A UI control shown in the Touch Bar on supported models of MacBook Pro.

class NSCandidateListTouchBarItem

A bar item that, along with its delegate, provides a list of textual suggestions for the current text view.

class NSColorPickerTouchBarItem

A bar item that provides a system-defined color picker.

class NSCustomTouchBarItem

A bar item that contains a responder of your choice, such as a view, a button, or a scrubber (an instance of the NSScrubber class).

class NSGroupTouchBarItem

A bar item that provides a bar to contain other items.

class NSPopoverTouchBarItem

A bar item that provides a two-state control that can expand into its second state, showing the contents of a bar that it owns.

class NSSharingServicePickerTouchBarItem

A bar item that, along with its delegate, provides a list of objects eligible for sharing.

class NSSliderTouchBarItem

A bar item that provides a slider control for choosing a value in a range.