简体   繁体   中英

UICollectionViewDiffableDataSource snapshot for static cell

In my UICollectionView, I have a header supplementary view that is static and doesn't receive any value to be configured.

So, when I'm creating a snapshot for UICollectionViewDiffableDataSource, I need to pass something like () for this section as a data, to fill the section with something. But () is not Hashable, so it doesn't work.

So, how to work with the static content like that when I'm generally using diffable data source to populate UICollectionView?

Have you tried creating a dummy data structure that conforms to the Hashable protocol and just pass it in?

https://developer.apple.com/documentation/swift/hashable

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM