<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDirectionalEdgeInsets",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@S@NSDirectionalEdgeInsets"
  },
  "title" : "NSDirectionalEdgeInsets"
}
-->

# NSDirectionalEdgeInsets

The inset distances for views, taking the user interface layout direction into account.

```
struct NSDirectionalEdgeInsets
```

## Topics

### Creating directional edge insets

[`init()`](/documentation/AppKit/NSDirectionalEdgeInsets/init())

Creates a directional edge insets structure that contains default values.

[`init(top: CGFloat, leading: CGFloat, bottom: CGFloat, trailing: CGFloat)`](/documentation/AppKit/NSDirectionalEdgeInsets/init(top:leading:bottom:trailing:))

Creates a directional edge insets structure that contains the specified values.

### Creating directional edge insets

[`static NSDirectionalEdgeInsets NSDirectionalEdgeInsetsMake(CGFloat top, CGFloat leading, CGFloat bottom, CGFloat trailing);`](/documentation/AppKit/NSDirectionalEdgeInsetsMake)

### Getting the edge values

[`var bottom: CGFloat`](/documentation/AppKit/NSDirectionalEdgeInsets/bottom)

The bottom edge inset value.

[`var leading: CGFloat`](/documentation/AppKit/NSDirectionalEdgeInsets/leading)

The leading edge inset value.

[`var top: CGFloat`](/documentation/AppKit/NSDirectionalEdgeInsets/top)

The top edge inset value.

[`var trailing: CGFloat`](/documentation/AppKit/NSDirectionalEdgeInsets/trailing)

The trailing edge inset value.

### Converting to and from strings

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/string(for:)-hp8b>

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/nsDirectionalEdgeInsets(for:)>

### Getting the empty edge insets

[`let NSDirectionalEdgeInsetsZero: NSDirectionalEdgeInsets`](/documentation/AppKit/NSDirectionalEdgeInsetsZero)

A directional edge insets structure whose top, leading, bottom, and trailing fields all have a value of `0`.

### Initializers

[`init(EdgeInsets)`](/documentation/AppKit/NSDirectionalEdgeInsets/init(_:))

Create edge insets from the equivalent EdgeInsets.

## Relationships

### Conforms To

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

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

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

---

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)