<!--
{
  "availability" : [
    "iOS: 8.0.0 - 10.0.0",
    "iPadOS: 8.0.0 - 10.0.0",
    "macCatalyst: 8.0.0 - 10.0.0",
    "macOS: 10.10.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "NotificationCenter",
  "identifier" : "/documentation/NotificationCenter/NCWidgetProviding/widgetMarginInsets(forProposedMarginInsets:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Notification Center"
    ],
    "preciseIdentifier" : "c:objc(pl)NCWidgetProviding(im)widgetMarginInsetsForProposedMarginInsets:"
  },
  "title" : "widgetMarginInsets(forProposedMarginInsets:)"
}
-->

# widgetMarginInsets(forProposedMarginInsets:)

Called to let a widget accept the default margin inset values or return custom values to use instead.

```
optional func widgetMarginInsets(forProposedMarginInsets defaultMarginInset: NSEdgeInsets) -> NSEdgeInsets
```

## Parameters

`defaultMarginInsets`

The default margin insets that are available to the widget.

## Return Value

A value of type <doc://com.apple.documentation/documentation/UIKit/UIEdgeInsets> that contains the custom margin insets a widget is using instead of the default values.

## Discussion

A widget can implement this method to return custom margin inset values to use instead of the default values specified in `defaultMarginInsets`. (If the widget doesn’t need to use custom values, it should return the unchanged default values in its implementation.) If a widget doesn’t implement this method, it automatically receives the default margin inset values.

---

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)