---
title: hasEqualSpacing
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsstackview/hasequalspacing
---

# hasEqualSpacing

A Boolean value that indicates whether the spacing between adjacent views should be equal to each other.

## Declaration

```swift
var hasEqualSpacing: Bool { get set }
```

## Discussion

Discussion The distances between adjacent views in a stack view are either constrained to equal each other or settable to custom spacings using the setCustomSpacing(_:after:) method. The default value for the hasEqualSpacing property is false, which enables custom spacing. To require equal spacing, set this property to true, which disables the setCustomSpacing(_:after:) method. With hasEqualSpacing set to false (the default), the Auto Layout constraints for spacing between views in a gravity area are as shown in the table of the spacing property. If you specify equal spacing, the system changes these constraints to the values shown in the table below.  |   |   |   |  Stack view hugging priority, identified as the constraint value in row 1, has the default value defaultLow. You can adjust hugging priority by using the setHuggingPriority(_:for:) method.

## See Also

### Related Documentation

- [setHuggingPriority(_:for:)](appkit/nsstackview/sethuggingpriority(_:for:).md)

### Configuring the Stack View Layout

- [orientation](appkit/nsstackview/orientation.md)
- [NSUserInterfaceLayoutOrientation](appkit/nsuserinterfacelayoutorientation.md)
- [alignment](appkit/nsstackview/alignment.md)
- [spacing](appkit/nsstackview/spacing.md)
- [useDefaultSpacing](appkit/nsstackview/usedefaultspacing.md)
- [edgeInsets](appkit/nsstackview/edgeinsets.md)
- [distribution](appkit/nsstackview/distribution-swift.property.md)
- [NSStackView.Distribution](appkit/nsstackview/distribution-swift.enum.md)
