There is a layout issue about number of column for iPhone 12 ( In case of iPhone12, It displays 2 number of column, not standard 3 )
ScreenShot
Solution
At first, I expected calculation issue, but it seems fine and it fits with iPhone12 390 width ( 3 items(380) + 10 spacing(5,5))
Calculation Debug Result
I think it's bug or floating point issue or something. MinimumInteritemSpacing is set to 5, and with some reason, 3 items width calculation is more than 380. As a result, collectionView layout make its column number to 2 in order to conform minimumInteritemSpacing value ( 5 ).
And what I suggest is that column number of 3 should be preserved by changing minimumInteritemSpacing value.
Because even though margin of error for item size calculation exists, it is too small to make problem if we guarantee 3 number of column even with smaller spacing So spacing 5 is not important compared to column number issue ( cuz it makes broken layout ). and we are adding 5 * count-1 for size, even smaller spacing that happens is not that small. ( it might be 4.9xxx if happens because of some kind of bug )
In conclusion, I am using this in production level so I hope to fix this critical layout issue asap with this added one line unless it makes another problems. ( I checked other iphone models and many error cases, and found no issue. )
Problem
There is a layout issue about number of column for iPhone 12 ( In case of iPhone12, It displays 2 number of column, not standard 3 )
ScreenShot
Solution
At first, I expected calculation issue, but it seems fine and it fits with iPhone12 390 width ( 3 items(380) + 10 spacing(5,5))
Calculation Debug Result
I think it's bug or floating point issue or something. MinimumInteritemSpacing is set to 5, and with some reason, 3 items width calculation is more than 380. As a result, collectionView layout make its column number to 2 in order to conform minimumInteritemSpacing value ( 5 ).
And what I suggest is that column number of 3 should be preserved by changing minimumInteritemSpacing value. Because even though margin of error for item size calculation exists, it is too small to make problem if we guarantee 3 number of column even with smaller spacing So spacing 5 is not important compared to column number issue ( cuz it makes broken layout ). and we are adding 5 * count-1 for size, even smaller spacing that happens is not that small. ( it might be 4.9xxx if happens because of some kind of bug )
In conclusion, I am using this in production level so I hope to fix this critical layout issue asap with this added one line unless it makes another problems. ( I checked other iphone models and many error cases, and found no issue. )
Fixed ScreenShoot