init
This commit is contained in:
37
snippets/swift-mode/uicollectionviewdatasource
Normal file
37
snippets/swift-mode/uicollectionviewdatasource
Normal file
@@ -0,0 +1,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
|
||||
}
|
||||
Reference in New Issue
Block a user