<!--
{
  "availability" : [
    "macOS: 10.9.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSStackView/customSpacing(after:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSStackView(im)customSpacingAfterView:"
  },
  "title" : "customSpacing(after:)"
}
-->

# customSpacing(after:)

Returns the custom spacing, in points, between a specified view in the stack view and the view that follows it.

```
func customSpacing(after view: NSView) -> CGFloat
```

## Parameters

`view`

The view whose trailing spacing you are getting.

## Return Value

The number of points between the trailing edge of the specified view and the one that follows it (that is, the one with the next highest index order).

## Discussion

If you set custom spacing for a view using the [`setCustomSpacing(_:after:)`](/documentation/AppKit/NSStackView/setCustomSpacing(_:after:)) method, it overrides the stack view’s default spacing as set in the [`spacing`](/documentation/AppKit/NSStackView/spacing) property.

A stack view retains custom spacing across layout updates. Custom spacing for a view is lost if you remove the view from the stack view or specify a new value.

---

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)