<!--
{
  "availability" : [
    "iOS: 10.0.0 - 14.0.0",
    "iPadOS: 10.0.0 - 14.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSExtensionContext/widgetMaximumSize(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSExtensionContext(im)widgetMaximumSizeForDisplayMode:"
  },
  "title" : "widgetMaximumSize(for:)"
}
-->

# widgetMaximumSize(for:)

Returns the maximum size for the specified widget display mode.

```
func widgetMaximumSize(for displayMode: NCWidgetDisplayMode) -> CGSize
```

## Parameters

`displayMode`

The active display mode of the widget. For possible values, see <doc://com.apple.documentation/documentation/NotificationCenter/NCWidgetDisplayMode>.

## Discussion

---

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)