I\'m making an iOS app in swift, and I\'m trying to make a collectionView programmatically. I want to use my own subclass of UICollectionReusableView as a header for the Col
you can do it like this:
// Setup Header
self.collectionView?.registerClass(CollectionCustomHeader.self, forSupplementaryViewOfKind: CustomeHeaderHeader, withReuseIdentifier: "customHeader")
also:
override func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
if kind == CustomeHeaderHeader {
let view = collectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: "parallaxHeader", forIndexPath: indexPath)
return view
}