UICollectionReusableView method not being called

后端 未结 11 718
暗喜
暗喜 2021-01-31 13:13

I want my sections in the UICollectionView to have a header with an image.

I have followed these steps:

  • at the storyboard, assigned a header a
11条回答
  •  盖世英雄少女心
    2021-01-31 13:43

        @objc (collectionView:viewForSupplementaryElementOfKind:atIndexPath:)
        func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { }
    

    The above code worked for me

提交回复
热议问题