Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created July 2, 2020 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencurtis/af816045192163ecd931891f9d387148 to your computer and use it in GitHub Desktop.
Save stevencurtis/af816045192163ecd931891f9d387148 to your computer and use it in GitHub Desktop.
layoutsectionprotocol
protocol LayoutSection {
var layoutSection: NSCollectionLayoutSection {get}
func configureCell(collectionView: UICollectionView,
indexPath: IndexPath,
item: AnyHashable,
position: Int) -> UICollectionViewCell
func header(collectionView: UICollectionView, indexPath: IndexPath) -> UICollectionReusableView?
}
extension LayoutSection {
func header(collectionView: UICollectionView, indexPath: IndexPath) -> UICollectionReusableView? {
return nil
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment