Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- registerClass(myFooterViewClass, forSupplementaryViewOfKind: UICollectionElementKindSectionFooter, withReuseIdentifier: "Footer")
- override func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
- switch kind {
- case UICollectionElementKindSectionHeader:
- let header = collectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: "Header", forIndexPath: indexPath) as! UICollectionReusableView
- header = SomeView
- return header
- case UICollectionElementKindSectionFooter:
- let footer = collectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: "Footer", forIndexPath: indexPath) as! UICollectionReusableView
- footer= SomeView
- return footer
- default:
- print("anything")
- }
- }
- func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
- let sectionView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "FutterView", for: indexPath) as! CollectionReusableView
- return sectionView
- }
- @IBAction func ButtonClick(_ sender: Any) {
- print("Click 1st")
- }
- @IBAction func ButtonClick2(_ sender: Any) {
- print("Click 2nd")
- }
Add Comment
Please, Sign In to add comment