CollectionViewDelegateListLayout
@objc
public protocol CollectionViewDelegateListLayout : CollectionViewDelegate
A vertical list based layout similiar to a native table view
-
Asks the delegate for the height of the item at index path
Declaration
Swift
@objc optional func collectionView(_ collectionView: CollectionView, layout collectionViewLayout: CollectionViewLayout, heightForItemAt indexPath: IndexPath) -> CGFloat
Parameters
collectionView
The asking collection view
collectionViewLayout
The layout
indexPath
The index path for the item in question
Return Value
The height for the item
-
Asks the delegate for the height of the header in a given section
Declaration
Swift
@objc optional func collectionView(_ collectionView: CollectionView, layout collectionViewLayout: CollectionViewLayout, heightForHeaderInSection section: Int) -> CGFloat
Parameters
collectionView
The asking collection view
collectionViewLayout
The layout
section
A section index
Return Value
The desired height of section header or 0 for no header
-
Asks the delegate for the height of the footer in a given section.
Declaration
Swift
@objc optional func collectionView(_ collectionView: CollectionView, layout collectionViewLayout: CollectionViewLayout, heightForFooterInSection section: Int) -> CGFloat
Parameters
collectionView
The asking collection view
collectionViewLayout
The layout
section
The section of the footer in question
Return Value
The desired height of the section footer or 0 for no footer
-
Asks the delegate for the spacing between items in a given section
Declaration
Swift
@objc optional func collectionView(_ collectionView: CollectionView, layout collectionViewLayout: CollectionViewLayout, interitemSpacingForItemsInSection section: Int) -> CGFloat
Parameters
collectionView
The asking collection view
collectionViewLayout
The layout
section
A section index
Return Value
The desired item spacing to be applied between items in the given section
-
Asks the delegate for insets to use when laying out items in a given section
Declaration
Swift
@objc optional func collectionView(_ collectionView: CollectionView, layout collectionViewLayout: CollectionViewLayout, insetForSectionAt section: Int) -> NSEdgeInsets
Parameters
collectionView
The asking collection view
collectionViewLayout
The layout
section
A section index
Return Value
The edge insets for the section