I want to add footer to a UICollectionView
using this code. i am using Using Custom Layout in UICollectionView layout
Added delegate and datasource methods :-
UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout
Code in viewdDidLoad()
function :-
UINib(nibName: "ProfileFooter", bundle:nil)
collectionView!.registerNib(nibName1, forSupplementaryViewOfKind: UICollectionElementKindSectionFooter, withReuseIdentifier: "ProfileFooter")
collectionView.registerClass(ProfileFooter.classForCoder(), forSupplementaryViewOfKind: "ProfileFooter", withReuseIdentifier: "ProfileFooter")
func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
var reusable = UICollectionReusableView()
if kind == UICollectionElementKindSectionFooter{
let ProfileFooter = collectionView.dequeueReusableSupplementaryViewOfKind(UICollectionElementKindSectionFooter, withReuseIdentifier: "ProfileFooter", forIndexPath: indexPath)
ProfileFooter.backgroundColor = UIColor.redColor()
reusable = ProfileFooter
}
return reusable
}
can any one check what is wrong in this ??