The custom distance that the content view is inset from the safe area or scroll view edges.
SDKs
- iOS 2.0+
- tvOS 9.0+
Framework
- UIKit
Declaration
var contentInset: UIEdge Insets { 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 UIEdge
.
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—that is, the safe area plus your custom insets—using the adjusted
property. To change how the safe area is applied, modify the content
property.