UICollectionViewLayout "Blocked" Error Message

After (successful) call

__weak typeof(self) wself = self; [self.collectionView performBatchUpdates:^{ [wself.collectionView.collectionViewLayout invalidateLayout]; [wself.collectionView setCollectionViewLayout:self.layoutDeletion animated:YES]; } completion:nil]; 

The following error message appears:
trying to load collection view layout data when layout is locked

the operation works fine, except that one particular UICollectionViewCell does not load its routines.
I have never seen this error message before, including google. Any ideas what might cause this?

+5
source share
2 answers

The error is generated by calling setCollectionViewLayout inside performBatchUpdates . It is unclear whether this is the expected behavior (coding error) or an error in iOS. You can report this issue to Apple, but at the same time you need to reorganize the layout change without batch updates. You can always use the completion handler to perform any additional updates in the collection view.

+7
source

I had the same problem on iOS 8 ... Actually, I just deleted the performBatchUpdates method: and it worked fine for me!

0
source

Source: https://habr.com/ru/post/1201321/


All Articles