<!--
{
  "availability" : [
    "macOS: 10.13.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSUserInterfaceCompressionOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSUserInterfaceCompressionOptions"
  },
  "title" : "NSUserInterfaceCompressionOptions"
}
-->

# NSUserInterfaceCompressionOptions

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

```
class NSUserInterfaceCompressionOptions
```

## Overview

An instance of [`NSUserInterfaceCompressionOptions`](/documentation/AppKit/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:)`](/documentation/AppKit/NSUserInterfaceCompressionOptions/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`](/documentation/AppKit/NSUserInterfaceCompressionOptions/init())

Creates an option object containing no options.

[`-  initWithCompressionOptions:`](/documentation/AppKit/NSUserInterfaceCompressionOptions/init(options:))

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

[`-  initWithIdentifier:`](/documentation/AppKit/NSUserInterfaceCompressionOptions/init(identifier:))

Creates an option object with the given identifier string.

[`-  initWithCoder:`](/documentation/AppKit/NSUserInterfaceCompressionOptions/init(coder:))

Creates an option object from data in an unarchiver.

### Creating standard options

[`hideImagesOption`](/documentation/AppKit/NSUserInterfaceCompressionOptions/hideImages)

An option specifying that views should hide their images.

[`hideTextOption`](/documentation/AppKit/NSUserInterfaceCompressionOptions/hideText)

An option specifying that views should hide their text.

[`reduceMetricsOption`](/documentation/AppKit/NSUserInterfaceCompressionOptions/reduceMetrics)

An option specifying that views should reduce their internal metrics.

[`breakEqualWidthsOption`](/documentation/AppKit/NSUserInterfaceCompressionOptions/breakEqualWidths)

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

[`standardOptions`](/documentation/AppKit/NSUserInterfaceCompressionOptions/standardOptions)

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

### Comparing compression options

[`empty`](/documentation/AppKit/NSUserInterfaceCompressionOptions/isEmpty)

A Boolean value that denotes whether the option is empty.

[`-  containsOptions:`](/documentation/AppKit/NSUserInterfaceCompressionOptions/contains(_:))

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

[`-  intersectsOptions:`](/documentation/AppKit/NSUserInterfaceCompressionOptions/intersects(_:))

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

### Combining compression options

[`-  optionsByAddingOptions:`](/documentation/AppKit/NSUserInterfaceCompressionOptions/union(_:))

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

[`-  optionsByRemovingOptions:`](/documentation/AppKit/NSUserInterfaceCompressionOptions/subtracting(_:))

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

## Relationships

### Conforms To

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Hashable`](/documentation/Swift/Hashable)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)