SegmentedCollectionViewDelegate

public protocol SegmentedCollectionViewDelegate: AnyObject

A set of methods that your delegate object must implement to interact with the segmented collection view.

A default implementation of the function considered optional exists for objects inheriting from NSObject.

  • heightOfHeaderView(in:) Default implementation

    Asks the delegate for the height to use for the header view.

    Default Implementation

    Declaration

    Swift

    func heightOfHeaderView(in collectionView: SegmentedCollectionView) -> CGFloat

    Parameters

    collectionView

    The SegmentedCollectionView object requesting this information.

    Return Value

    A nonnegative floating-point value that specifies the height (in points) that the header view should be.

  • verticalPaddingForItems(in:) Default implementation

    Asks the delegate for the size of the vertical padding to use for items.

    Default Implementation

    Declaration

    Swift

    func verticalPaddingForItems(in collectionView: SegmentedCollectionView) -> CGFloat

    Parameters

    collectionView

    The SegmentedCollectionView object requesting this information.

    Return Value

    A nonnegative floating-point value that specifies the dimension (in points) that the vertical padding of the collection view should be.

  • Asks the delegate how many columns should be displayed for one of the section of the view.

    Default Implementation

    Declaration

    Swift

    func segmentedCollectionView(_ collectionView: SegmentedCollectionView,

    Parameters

    collectionView

    The SegmentedCollectionView object requesting this information.

    section

    An index number identifying a section of the collectionView.

    Return Value

    The number of columns in section.

  • Asks the delegate for the height to use for a row in a specified location.

    Default Implementation

    Declaration

    Swift

    func segmentedCollectionView(_ collectionView: SegmentedCollectionView,

    Parameters

    collectionView

    The SegmentedCollectionView object requesting this information.

    width

    The width that will be used for the cell.

    section

    An index number identifying a section of the collectionView.

    Return Value

    A nonnegative floating-point value that specifies the height (in points) that the item’s cell should be.