My UICollectionView footer does not display any of its subzones. I was looking for answers, but in my case nothing works. I'm not sure if this is something in Swift, or if I just missed something.
In my storyboard, I checked the Footer box and added a few buttons to the footer. I set the reusable identifier to the "footer" and registered it in the view controller as a. Then I called collectionView(collectionView: UICollectionView!, viewForSupplementaryElementOfKind kind: String!, atIndexPath indexPath: NSIndexPath!) , Which sets it. However, when I launch the application, the footer does not show any subzones ( footer.subviews.count = 0). The footer border is correct, but why are the sub-items that I put in the storyboard not showing up?
Here is the code:
override func viewDidLoad() { ... uiCollectionView.registerClass(MyFooterView.classForCoder(), forSupplementaryViewOfKind: UICollectionElementKindSectionFooter, withReuseIdentifier: "footer") } func collectionView(collectionView: UICollectionView!, viewForSupplementaryElementOfKind kind: String!, atIndexPath indexPath: NSIndexPath!) -> UICollectionReusableView! { let reusableView:MyFooterView = collectionView.dequeueReusableSupplementaryViewOfKind(UICollectionElementKindSectionFooter, withReuseIdentifier: "footer", forIndexPath: indexPath) as MyFooterView println("Footer subivews: \(reusableView.subviews.count)")
source share