<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SharedWithYou",
  "identifier" : "/documentation/SharedWithYou/SWAttributionView/preferredMaxLayoutWidth",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Shared with You"
    ],
    "preciseIdentifier" : "c:objc(cs)SWAttributionView(py)preferredMaxLayoutWidth"
  },
  "title" : "preferredMaxLayoutWidth"
}
-->

# preferredMaxLayoutWidth

A width the system uses to constrain the view contents.

```
var preferredMaxLayoutWidth: CGFloat { get set }
```

## Discussion

When embedding this view in a SwiftUI <doc://com.apple.documentation/documentation/SwiftUI/UIViewRepresentable> or <doc://com.apple.documentation/documentation/SwiftUI/NSViewRepresentable> view, the system constrains its contents to the `preferredMaxLayoutWidth` width.

If you’re not using SwiftUI this property shouldn’t be necessary, as [`SWAttributionView`](/documentation/SharedWithYou/SWAttributionView) otherwise derives the maximum width from the frame or constraints you set.

---

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)