One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

EdgeInsets

struct · iOS 13.0+ · SDK 27.1

@frozen struct EdgeInsets

The inset distances for the sides of a rectangle.

Members (13)

get · iOS 13.0+

animatableData

TypeScript
get animatableData(): AnimatablePair<number, AnimatablePair<number, AnimatablePair<number, number>>>
Swift declaration
var animatableData: EdgeInsets.AnimatableData { get set }

The data to animate. SwiftUI reads this property to capture the current vector representation of the animatable state, and writes it back on each animation frame with an interpolated value. The default implementation returns ``EmptyAnimatableData``, meaning nothing is animated. Use the ``Animatable()`` macro to synthesize this property automatically. Implement it by hand only when you need custom interpolation logic such as clamping, normalization, or mapping to a derived value.

set · iOS 13.0+

animatableData

TypeScript
set animatableData(value: AnimatablePair<number, AnimatablePair<number, AnimatablePair<number, number>>>)
Swift declaration
var animatableData: EdgeInsets.AnimatableData { get set }

The data to animate. SwiftUI reads this property to capture the current vector representation of the animatable state, and writes it back on each animation frame with an interpolated value. The default implementation returns ``EmptyAnimatableData``, meaning nothing is animated. Use the ``Animatable()`` macro to synthesize this property automatically. Implement it by hand only when you need custom interpolation logic such as clamping, normalization, or mapping to a derived value.

get · iOS 13.0+

top

TypeScript
get top(): number
Swift declaration
var top: CGFloat
set · iOS 13.0+

top

TypeScript
set top(value: number)
Swift declaration
var top: CGFloat
init · iOS 13.0+

init

TypeScript
static initTopLeadingBottomTrailing(top: number, leading: number, bottom: number, trailing: number): EdgeInsets
Swift declaration
init(top: CGFloat, leading: CGFloat, bottom: CGFloat, trailing: CGFloat)
method · iOS 26.0+

inset

TypeScript
inset(corners: RectangleCornerInsets, edges?: Edge_Set): EdgeInsets
Swift declaration
func inset(by corners: RectangleCornerInsets, edges: Edge.Set = .all) -> EdgeInsets

Returns an inset that has been modified by the corner sizes in the specified edges. When two corner insets diverge in their values for the specified edge, the maximum inset value will be used. For example, when the top edge is specified, the top inset will be adjusted by the larger of the two heights from the top leading and trailing corner inset sizes. - Parameters: - corners: The corner sizes to add to the insets. - edges: The set of corner edges which should be added to the insets.

get · iOS 13.0+

bottom

TypeScript
get bottom(): number
Swift declaration
var bottom: CGFloat
set · iOS 13.0+

bottom

TypeScript
set bottom(value: number)
Swift declaration
var bottom: CGFloat
get · iOS 13.0+

leading

TypeScript
get leading(): number
Swift declaration
var leading: CGFloat
set · iOS 13.0+

leading

TypeScript
set leading(value: number)
Swift declaration
var leading: CGFloat
get · iOS 13.0+

trailing

TypeScript
get trailing(): number
Swift declaration
var trailing: CGFloat
set · iOS 13.0+

trailing

TypeScript
set trailing(value: number)
Swift declaration
var trailing: CGFloat
init · iOS 13.0+

init

TypeScript
static init(): EdgeInsets
Swift declaration
init()

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →