我已經在故事板中創建了UICollectionViewController以及集合視圖的標題。自定義UICollectionViewLayout標題和故事板
我正在使用名爲CHTCollectionViewWaterfallLayout
的第三方UICollectionViewLayout
。當collectionView(_:viewForSupplementaryElementOfKind:atIndexPath:)
被稱爲頭,kind
是CHTCollectionElementKindSectionHeader
而不是UICollectionElementKindSectionHeader
和程序崩潰,並告訴我我沒有註冊一個類爲CHTCollectionElementKindSectionHeader
。說得通。但是,如果我以編程方式爲CHTCollectionElementKindSectionHeader
註冊一個班級,我不會從故事板中獲益,因爲程序在初始化標題時將調用initWithFrame:
而不是initWithCoder
。
有沒有什麼辦法可以解決這個問題,我可以以某種方式使用我在故事板中創建的CHTCollectionElementKindSectionHeader
?
的OBJ-C的夫特? – Konsy
我在swift中寫過它,但是知道在實現(而不是語法)方面是否存在巨大差異。 – theNotSoPro