kishikawakatsumi / IBPCollectionViewCompositionalLayout

Backport of UICollectionViewCompositionalLayout to earlier iOS 12
MIT License
1.55k stars 148 forks source link

Crashing for below layout configuration #118

Closed mukyasa closed 5 years ago

mukyasa commented 5 years ago
    let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),
                                          heightDimension: .estimated(100))
    let item = NSCollectionLayoutItem(layoutSize: itemSize)
    item.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: .fixed(8),
                                                     top: .fixed(8),
                                                     trailing: .fixed(8),
                                                     bottom: .fixed(8))
    let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),
                                           heightDimension: .estimated(100))
    let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize,
                                                   subitems: [item])

    let section = NSCollectionLayoutSection(group: group)
    let layout = UICollectionViewCompositionalLayout(section: section)
    return layout

Hello Team, Thank you for this library, I have been playing with estimate dimension and when i try to set the below code

       item.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: .fixed(8),
                                                         top: .fixed(8),
                                                         trailing: .fixed(8),
                                                         bottom: .fixed(8)) 

it crashes at this line

Screenshot 2019-09-26 at 12 16 43 PM

kishikawakatsumi commented 5 years ago

@mukyasa The code also goes into UIKit's UICollectionViewCompositionalLayout in an infinite loop. The layout does not work correctly even on UIKit's UICollectionViewCompositionalLayout unfortunately.

It's a UIKit's bug. So please report the issue to Apple. I also send bug report to Apple.

Thank you for reporting! Feel free to reopen if you have any questions or further info.