I migrated this project (an iMessage app with a collection view to hold stickers) from Swift 3 to Swift 5, and everything works but the header view function simply will not fire, nor will header show up.
I register the header cell in storyboard:
then in collection view functions:
private func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
let headerView: HeaderCollectionReusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "headerCell", for: indexPath as IndexPath) as! HeaderCollectionReusableView
print("CALLED")
//header1 = headerView as! UICollectionReusableView
return headerView
}
Ive even tried turning the header a different color in storyboard, however this function doesn't even print to console. What is wrong here? This used to work and the other cells work.