---
title: contentEdgeInsets
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uibutton/contentedgeinsets
---

# contentEdgeInsets

The inset or outset margins for the rectangle surrounding all of the button’s content.

## Declaration

```swift
var contentEdgeInsets: UIEdgeInsets { get set }
```

## Discussion

Discussion Use this property to resize and reposition the effective drawing rectangle for the button content. The content comprises the button image and button title. You can specify a different value for each of the four insets (top, left, bottom, right). A positive value shrinks, or insets, that edge—moving it closer to the center of the button. A negative value expands, or outsets, that edge. Use the init(top:left:bottom:right:) function to construct a value for this property. The default value is zero. The button uses this property to determine intrinsicContentSize and sizeThatFits(_:).

## See Also

### Edge insets

- [titleEdgeInsets](uikit/uibutton/titleedgeinsets.md)
- [imageEdgeInsets](uikit/uibutton/imageedgeinsets.md)
