I have ViewController
with the CollectionView
in it.
I want to change CollectionView
insets by pressing button. What code I should implement?
Thank you!
Set the section inset and invalidate the layout.
let collectionViewLayout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout
collectionViewLayout?.sectionInset = ... // some UIEdgeInset
collectionViewLayout?.invalidateLayout()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With