---
title: "customSpacing(after:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsstackview/customspacing(after:)"
---

# customSpacing(after:)

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

## Declaration

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

## Parameters

- `view`: The view whose trailing spacing you are getting.

## Return Value

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

Discussion If you set custom spacing for a view using the setCustomSpacing(_:after:) method, it overrides the stack view’s default spacing as set in the 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.

## See Also

### Configuring Views in a Stack View

- [setCustomSpacing(_:after:)](appkit/nsstackview/setcustomspacing(_:after:).md)
- [visibilityPriority(for:)](appkit/nsstackview/visibilitypriority(for:).md)
- [setVisibilityPriority(_:for:)](appkit/nsstackview/setvisibilitypriority(_:for:).md)
- [NSStackView.VisibilityPriority](appkit/nsstackview/visibilitypriority.md)
- [useDefaultSpacing](appkit/nsstackview/usedefaultspacing.md)
