<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIScrollView/contentInset",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIScrollView(py)contentInset"
  },
  "title" : "contentInset"
}
-->

# contentInset

The custom distance that the content view is inset from the safe area or scroll view edges.

```
var contentInset: UIEdgeInsets { get set }
```

## Discussion

Use this property to extend the space between your content and the edges of the content view. The unit of size is points. The default value is [`zero`](/documentation/UIKit/UIEdgeInsets/zero).

By default, UIKit automatically adjusts the content inset to account for overlapping bars. You use this property to extend that distance even further, perhaps to accommodate your own custom content. Get the total adjustment — the safe area plus your custom insets — using the [`adjustedContentInset`](/documentation/UIKit/UIScrollView/adjustedContentInset) property. To change how the safe area is applied, modify the [`contentInsetAdjustmentBehavior`](/documentation/UIKit/UIScrollView/contentInsetAdjustmentBehavior-swift.property) property.

---

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)