Contents

contentInset

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

Declaration

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.

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 property. To change how the safe area is applied, modify the contentInsetAdjustmentBehavior property.

See Also

Managing the content inset behavior