<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISheetPresentationController/widthFollowsPreferredContentSizeWhenEdgeAttached",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISheetPresentationController(py)widthFollowsPreferredContentSizeWhenEdgeAttached"
  },
  "title" : "widthFollowsPreferredContentSizeWhenEdgeAttached"
}
-->

# widthFollowsPreferredContentSizeWhenEdgeAttached

A Boolean value that determines whether the sheet’s width matches its view controller’s preferred content size.

```
var widthFollowsPreferredContentSizeWhenEdgeAttached: Bool { get set }
```

## Discussion

The default value is <doc://com.apple.documentation/documentation/Swift/false>, which means the sheet’s width equals the width of its container’s safe area. Set this value to <doc://com.apple.documentation/documentation/Swift/true> to use your view controller’s [`preferredContentSize`](/documentation/UIKit/UIViewController/preferredContentSize) to determine the width of the sheet instead.

This property doesn’t have an effect when the sheet is in a compact-width and regular-height size class, or when [`prefersEdgeAttachedInCompactHeight`](/documentation/UIKit/UISheetPresentationController/prefersEdgeAttachedInCompactHeight) is <doc://com.apple.documentation/documentation/Swift/false>.

---

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)