CustomLayout
CustomLayout copied to clipboard
生成LayoutAttributes时创建indexPath不要用indexPathWithIndex。crash!
生成LayoutAttributes时创建indexPath用indexPathWithIndex,会导致在swift中的collectionView返回组头viewForSupplementaryElementOfKind这个方法取indexPath.section时崩溃。改成 NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:i]; 就好了
@451222664 谢谢 没有用 swift 试过 ,最近会改写成 swift
跟Swift没关系,你在你demo的viewForSupplementaryElementOfKind方法打印 indexPath.section 也会崩