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.
-
Tells the delegate that the specified item is now selected.
Declaration
Swift
func segmentedCollectionView(_ collectionView: SegmentedCollectionView,Parameters
collectionViewA
SegmentedCollectionViewobject informing the delegate about the new item selection.itemThe new selected item.
-
segmentedCollectionView(_:willDisplayHeader:)Default implementationTells the delegate that the segmented collection view is about to draw its header view.
Default Implementation
Declaration
Swift
func segmentedCollectionView(_ collectionView: SegmentedCollectionView,Parameters
collectionViewA
SegmentedCollectionViewobject informing the delegate of this impending event.headerThe header about to be drawn.
-
heightOfHeaderView(in:)Default implementationAsks the delegate for the height to use for the header view.
Default Implementation
Declaration
Swift
func heightOfHeaderView(in collectionView: SegmentedCollectionView) -> CGFloatParameters
collectionViewThe
SegmentedCollectionViewobject 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 implementationAsks the delegate for the size of the vertical padding to use for items.
Default Implementation
Declaration
Swift
func verticalPaddingForItems(in collectionView: SegmentedCollectionView) -> CGFloatParameters
collectionViewThe
SegmentedCollectionViewobject 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.
-
segmentedCollectionView(_:numberOfColumnsForSection:)Default implementationAsks 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
collectionViewThe
SegmentedCollectionViewobject requesting this information.sectionAn index number identifying a section of the collectionView.
Return Value
The number of columns in section.
-
segmentedCollectionView(_:heightForItemWithWidth:forSection:)Default implementationAsks the delegate for the height to use for a row in a specified location.
Default Implementation
Declaration
Swift
func segmentedCollectionView(_ collectionView: SegmentedCollectionView,Parameters
collectionViewThe
SegmentedCollectionViewobject requesting this information.widthThe width that will be used for the cell.
sectionAn 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.
View on GitHub
SegmentedCollectionViewDelegate Protocol Reference