An object that defines the space around the edges of items in a collection view.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
You use edge spacing to create additional spacing around the edges of an item to adjust the position of the item in relation to its container and other items.
The leading and trailing spaces within edge spacing differ in left-to-right versus right-to-left environments. In a left-to-right environment, the leading space is on the left, and the trailing space is on the right. In a right-to-left environment, the leading space is on the right, and the trailing space is on the left. This difference ensures that your collection view layout is built with support for right-to-left languages.
The following diagram shows the difference between adding 2 points of trailing edge spacing in a left-to-right versus a right-to-left environment.