Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

invalidateLayout equivalent in iOS8

I find calling invalidateLayout in iOS8 to cause crashy behaviour, probably due to the new invalidateLayout with contexts introduced last WWDC. Still, I haven't found an equivalent to invalidating the whole collection view layout.

Say I want it all to happen exactly like iOS7's invalidateLayout. What should be done?

iOS7: [collectionView.collectionViewLayout invalidateLayout];

iOS8: ???

like image 635
Uzaak Avatar asked Jun 30 '26 14:06

Uzaak


1 Answers

As of iOS 8 you will want to invalidate the layout within a batch update block:

    [collectionView performBatchUpdates:^{
        [layout invalidateLayout];
    } completion:nil];
like image 176
Ric Santos Avatar answered Jul 03 '26 20:07

Ric Santos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!