Skip to content

[Crash] Thread 1: EXC_ARITHMETIC (code=EXC_I386_DIV, subcode=0x0) #159

@MariyanskiDev

Description

@MariyanskiDev

Hello there! I have a section:

final class SomeSection: NSCollectionLayoutSection {
    
    convenience init() {
        let estimatedWidth: CGFloat = 100
        let itemSize = NSCollectionLayoutSize(widthDimension: .estimated(estimatedWidth),
                                              heightDimension: .absolute(30))
        let item = NSCollectionLayoutItem(layoutSize: itemSize)
        item.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: nil,
                                                         top: nil,
                                                         trailing: .fixed(8),
                                                         bottom: nil)
        let groupSize = NSCollectionLayoutSize(widthDimension: .estimated(estimatedWidth),
                                               heightDimension: .absolute(30))
        let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize,
                                                       subitems: [item])
                
        self.init(group: group)
        
        orthogonalScrollingBehavior = .continuous
        
        interGroupSpacing = 8
        
        contentInsets = NSDirectionalEdgeInsets(top: 12,
                                                leading: 16,
                                                bottom: 0,
                                                trailing: 0)
    }
}

And I got crash on iOS < 13:
Снимок экрана 2022-04-29 в 10 06 48

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions