我已经在故事板中创建了UICollectionViewController以及集合视图的标题。自定义UICollectionViewLayout标题和故事板
我正在使用名为CHTCollectionViewWaterfallLayout
的第三方UICollectionViewLayout
。当collectionView(_:viewForSupplementaryElementOfKind:atIndexPath:)
被称为头,kind
是CHTCollectionElementKindSectionHeader
而不是UICollectionElementKindSectionHeader
和程序崩溃,并告诉我我没有注册一个类为CHTCollectionElementKindSectionHeader
。说得通。但是,如果我以编程方式为CHTCollectionElementKindSectionHeader
注册一个班级,我不会从故事板中获益,因为程序在初始化标题时将调用initWithFrame:
而不是initWithCoder
。
有没有什么办法可以解决这个问题,我可以以某种方式使用我在故事板中创建的CHTCollectionElementKindSectionHeader
?
的OBJ-C的夫特? – Konsy
我在swift中写过它,但是知道在实现(而不是语法)方面是否存在巨大差异。 – theNotSoPro