kishikawakatsumi / IBPCollectionViewCompositionalLayout

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

Fix incorrect insets for sections #56

Closed notjosh closed 5 years ago

notjosh commented 5 years ago

🐛 I think the code mostly explains it, but it was using top/leading to add to the "end" of the size when calculating frames for decorations.

This is definitely an easy one to miss! In most of the code samples (from Apple, etc), the insets are the same on all edges, but I have to use different insets for top/bottom (and leading/trailing) for the layout I'm building, and this patch lays it out correctly 🙌

kishikawakatsumi commented 5 years ago

Thank you for your contribution!