<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSEdgeInsets",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@S@NSEdgeInsets"
  },
  "title" : "NSEdgeInsets"
}
-->

# NSEdgeInsets

A description of the distance between the edges of two rectangles.

```
struct NSEdgeInsets
```

## Overview

Edge insets describe the distance between the edges of one rectangle to a related rectangle that can be described by measuring a constant but edge-specific distance from each edge.

A common use for this structure is to describe the relationship between a view’s frame and its alignment rectangle.

## Topics

### Creating an edge insets structure

[`init(top:left:bottom:right:)`](/documentation/Foundation/NSEdgeInsets/init(top:left:bottom:right:))

Creates an edge insets structure with the specified inset values.

[`NSEdgeInsetsMake`](/documentation/Foundation/NSEdgeInsetsMake(_:_:_:_:))

Creates an edge insets structure with the specified inset values.

[`init()`](/documentation/Foundation/NSEdgeInsets/init())

Creates an edge insets structure.

### Specifying the edge insets

[`bottom`](/documentation/Foundation/NSEdgeInsets/bottom)

The distance from the bottom of the source rectangle to the bottom of the result rectangle.

[`left`](/documentation/Foundation/NSEdgeInsets/left)

The distance from the left side of the source rectangle to the left side of the result rectangle.

[`right`](/documentation/Foundation/NSEdgeInsets/right)

The distance from the right side of the source rectangle to the right side of the result rectangle.

[`top`](/documentation/Foundation/NSEdgeInsets/top)

The distance from the top of the source rectangle to the top of the result rectangle.

### Comparing edge insets

[`NSEdgeInsetsEqual`](/documentation/Foundation/NSEdgeInsetsEqual(_:_:))

Returns a Boolean value that indicates whether two edge insets structures are equal.

### Getting the zero constant

[`NSEdgeInsetsZero`](/documentation/Foundation/NSEdgeInsetsZero)

An edge insets structure with a zero inset on each edge.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)