Klimi's new dotfiles with stow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.2 KiB

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