<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "tvOS: 14.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIBackgroundConfiguration-swift.struct/backgroundInsets",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:5UIKit25UIBackgroundConfigurationV16backgroundInsetsSo017NSDirectionalEdgeE0Vvp"
  },
  "title" : "backgroundInsets"
}
-->

# backgroundInsets

The insets (or outsets, if negative) for the background and stroke, relative to the edges of the containing view.

```
var backgroundInsets: NSDirectionalEdgeInsets { get set }
```

## Discussion

This property applies to the custom view. The default value is [`zero`](/documentation/UIKit/NSDirectionalEdgeInsets/zero).

---

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)