<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/contentCompressionResistancePriority(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(im)contentCompressionResistancePriorityForOrientation:"
  },
  "title" : "contentCompressionResistancePriority(for:)"
}
-->

# contentCompressionResistancePriority(for:)

Returns the priority with which a view resists being made smaller than its intrinsic size.

```
func contentCompressionResistancePriority(for orientation: NSLayoutConstraint.Orientation) -> NSLayoutConstraint.Priority
```

## Parameters

`orientation`

The orientation of the dimension of the view that might be reduced.

## Return Value

The priority with which the view should resist being compressed from its intrinsic size in the specified orientation.

## Discussion

The constraint-based layout system uses these priorities when determining the best layout for views that are encountering constraints that would require them to be smaller than their intrinsic size.

Subclasses should not override this method. Instead, custom views should set default values for their content on creation, typically to [`defaultLow`](/documentation/AppKit/NSLayoutConstraint/Priority-swift.struct/defaultLow) or [`defaultHigh`](/documentation/AppKit/NSLayoutConstraint/Priority-swift.struct/defaultHigh).

---

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)