---
title: "widgetMarginInsets(forProposedMarginInsets:)"
framework: notificationcenter
role: symbol
role_heading: Instance Method
path: "notificationcenter/ncwidgetproviding/widgetmargininsets(forproposedmargininsets:)"
---

# widgetMarginInsets(forProposedMarginInsets:)

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

## Declaration

```swift
optional func widgetMarginInsets(forProposedMarginInsets defaultMarginInsets: UIEdgeInsets) -> UIEdgeInsets
```

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

## Parameters

- `defaultMarginInsets`: The default margin insets that are available to the widget.

## Return Value

Return Value A value of type UIEdgeInsets that contains the custom margin insets a widget is using instead of the default values.

## Discussion

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.

## See Also

### Customizing the Display

- [widgetActiveDisplayModeDidChange(_:withMaximumSize:)](notificationcenter/ncwidgetproviding/widgetactivedisplaymodedidchange(_:withmaximumsize:).md)
- [NCWidgetDisplayMode](notificationcenter/ncwidgetdisplaymode.md)
