1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
# -*- mode: snippet -*-
# name: uicollectionViewDataSource
# key: uicollectionViewDataSource
# --
// MARK: UICollectionViewDataSource
func numberOfSections(in collectionView: UICollectionView) -> Int {
return $1
}
func collectionView(_ collectionView: UICollectionView,
numberOfItemsInSection section: Int) -> Int {
// TODO:- Required Method
return $2
}
func collectionView(_ collectionView: UICollectionView,
cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell =
collectionView.dequeueReusableCell(withReuseIdentifier: $3, for: indexPath)
configureCell(cell: cell, forItemAt: indexPath)
// TODO:- Required Method
return cell
}
func configureCell(cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
}
func collectionView(_ collectionView: UICollectionView,
viewForSupplementaryElementOfKind kind: String,
at indexPath: IndexPath) -> UICollectionReusableView {
let view = collectionView.dequeueReusableSupplementaryView(
ofKind: UICollectionElementKindSectionHeader,
withReuseIdentifier: $3, for: indexPath) as UIView
return view
}
|