When attempting to call SwiftGridView.scrollToCellAtIndexPath when there are two frozen columns, and using an IndexPath whose sgColumn is equal to 1, the Layout method horizontalOffset(for:atColumn:atScrollPosition) will crash:
func horizontalOffset(for indexPath: IndexPath, atColumn column: Int, atScrollPosition scrollPosition: UICollectionViewScrollPosition) -> CGFloat {
var offset: CGFloat = 0.0
if (column > 0) {
for columnIndex: Int in self.frozenColumnsCount ..< column {
offset += self.zoomModifiedValue(self.layoutDelegate.collectionView(self.collectionView!, layout: self, widthOfColumnAtIndex: columnIndex))
}
}
if scrollPosition.contains(.right) {
offset += self.zoomModifiedValue(self.layoutDelegate.collectionView(self.collectionView!, layout: self, widthOfColumnAtIndex: column))
} else if scrollPosition.contains(.centeredHorizontally) {
offset += self.zoomModifiedValue(self.layoutDelegate.collectionView(self.collectionView!, layout: self, widthOfColumnAtIndex: column)) / 2
}
return offset
}
In this case self.frozenColumnsCount == 2, and column is 1.
When attempting to call SwiftGridView.scrollToCellAtIndexPath when there are two frozen columns, and using an IndexPath whose sgColumn is equal to 1, the Layout method horizontalOffset(for:atColumn:atScrollPosition) will crash:
In this case self.frozenColumnsCount == 2, and column is 1.