widgetMarginInsets(forProposedMarginInsets:)
Called to let a widget accept the default margin inset values or return custom values to use instead.
Declaration
optional func widgetMarginInsets(forProposedMarginInsets defaultMarginInsets: UIEdgeInsets) -> UIEdgeInsetsoptional func widgetMarginInsets(forProposedMarginInsets defaultMarginInset: NSEdgeInsets) -> NSEdgeInsetsParameters
- defaultMarginInsets:
The default margin insets that are available to the widget.
Return Value
A value of type 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.