Asks the delegate for the margins to apply to content in the specified section.
- iOS 6.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The collection view object displaying the flow layout.
The layout object requesting the information.
The index number of the section whose insets are needed.
The margins to apply to items in the section.
If you do not implement this method, the flow layout uses the value in its
section property to set the margins instead. Your implementation of this method can return a fixed set of margin sizes or return different margin sizes for each section.
Section insets are margins applied only to the items in the section. They represent the distance between the header view and the first line of items and between the last line of items and the footer view. They also indicate the spacing on either side of a single line of items. They do not affect the size of the headers or footers themselves.