Guest User

Untitled

a guest
Jan 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. registerClass(myFooterViewClass, forSupplementaryViewOfKind: UICollectionElementKindSectionFooter, withReuseIdentifier: "Footer")
  2.  
  3. override func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
  4.  
  5. switch kind {
  6.  
  7. case UICollectionElementKindSectionHeader:
  8.  
  9. let header = collectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: "Header", forIndexPath: indexPath) as! UICollectionReusableView
  10.  
  11. header = SomeView
  12. return header
  13.  
  14. case UICollectionElementKindSectionFooter:
  15. let footer = collectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: "Footer", forIndexPath: indexPath) as! UICollectionReusableView
  16.  
  17. footer= SomeView
  18. return footer
  19.  
  20. default:
  21.  
  22. print("anything")
  23. }
  24. }
  25.  
  26. func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
  27. let sectionView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "FutterView", for: indexPath) as! CollectionReusableView
  28.  
  29. return sectionView
  30. }
  31.  
  32. @IBAction func ButtonClick(_ sender: Any) {
  33. print("Click 1st")
  34. }
  35. @IBAction func ButtonClick2(_ sender: Any) {
  36. print("Click 2nd")
  37. }
Add Comment
Please, Sign In to add comment