首页 > 解决方案 > 补充视图的节号是多少?

问题描述

我正在与UICollectionViewController. 在某些时候需要对可见页脚进行一些配置,并且对于其中的每一个,我都需要知道它的当前节号。当前,因为部分可能会被替换,并且可重用视图的部分可能会更改。

self.collectionView.visibleSupplementaryViews(ofKind: UICollectionView.elementKindSectionFooter)
    .filter { $0.reuseIdentifier == reuseIdentifierFooter}
    .forEach {
        // Here I need to know the section number of each view
}

标签: swiftuicollectionviewuicollectionreusableview

解决方案



推荐阅读