<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIView/contentHuggingPriority(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIView(im)contentHuggingPriorityForAxis:"
  },
  "title" : "contentHuggingPriority(for:)"
}
-->

# contentHuggingPriority(for:)

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

```
func contentHuggingPriority(for axis: NSLayoutConstraint.Axis) -> UILayoutPriority
```

## Parameters

`axis`

The axis of the view that might be enlarged.

## Return Value

The priority with which the view should resist being enlarged from its intrinsic size on the specified axis.

## 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 larger than their intrinsic size.

---

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)