---
title: preferredMaxLayoutWidth
framework: sharedwithyou
role: symbol
role_heading: Instance Property
path: sharedwithyou/swattributionview/preferredmaxlayoutwidth
---

# preferredMaxLayoutWidth

A width the system uses to constrain the view contents.

## Declaration

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

## Discussion

Discussion When embedding this view in a SwiftUI UIViewRepresentable or 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 otherwise derives the maximum width from the frame or constraints you set.

## See Also

### Customizing highlights

- [backgroundStyle](sharedwithyou/swattributionview/backgroundstyle-swift.property.md)
- [displayContext](sharedwithyou/swattributionview/displaycontext-swift.property.md)
- [highlight](sharedwithyou/swattributionview/highlight.md)
- [highlightMenu](sharedwithyou/swattributionview/highlightmenu.md)
- [horizontalAlignment](sharedwithyou/swattributionview/horizontalalignment-swift.property.md)
- [menuTitleForHideAction](sharedwithyou/swattributionview/menutitleforhideaction.md)
- [supplementalMenu](sharedwithyou/swattributionview/supplementalmenu.md)
