我有两个集合视图单元格A和B,我需要同时加载这些单元格。但我没有找到任何解决方案我如何加载集合视图中的多个自定义视图swift
firstCollectionView.register(UINib(nibName: "A", bundle: Bundle.main), forCellWithReuseIdentifier: "A")
firstCollectionView.register(UINib(nibName: "B", bundle: Bundle.main), forCellWithReuseIdentifier: "B")
这是两个观点,以及如何可以在加载时间2次。
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "A", for:indexPath) as? A
在同一节或同细胞或任何其他情况? –
你的意思是什么? ...你需要两个不同的细胞还是? – John
您可以同时对A和B同时进行序列化,并选择要返回的哪一个 – Tj3n