Comments (4)
@ali0201
I tried to reset delegate for collectionView, it works! Thank you : )
if #available(iOS 13.0, *) { } else {
collectionView.delegate = nil
if collectionView.delegate == nil {
collectionView.delegate = self
}
}
collectionView.setCollectionViewLayout(layout, animated: false)
from ibpcollectionviewcompositionallayout.
I found the solution.
You can try like this.
- (void)setViewModel:(GGViewModel *)viewModel {
self.collectionView.dataSource = nil;
self.collectionView.delegate = nil;
if (!self.collectionView.dataSource) {
self.collectionView.dataSource = self;
}
if (!self.collectionView.delegate) {
self.collectionView.delegate = self;
}
[self.collectionView setCollectionViewLayout:layout animated:NO];
}
from ibpcollectionviewcompositionallayout.
I have a feature to switch layout ( grid <-> list), so I call setCollectionViewLayout to switch.
But if I start from 'grid -> list -> grid', it will crash.
From the call stack, we can see two IBPUICollectionViewCompositionalLayout is called repeatedly.p.s. in iOS version below iOS 13.
Example code as follow,
switch layoutMode { case .grid: collectionView.setCollectionViewLayout(grid, animated: false) case .list: collectionView.setCollectionViewLayout(list, animated: false) }
Hello, I also encountered this problem.
Have you solved it?
from ibpcollectionviewcompositionallayout.
@ali0201 not yet! I will give it a try, thank you!
from ibpcollectionviewcompositionallayout.
Related Issues (20)
- the below code of layout section before iOS 13 is not work correctly HOT 2
- No such module 'IBPCollectionViewCompositionalLayout' in UI Test if added via SPM
- Crash on below iOS 13 devices. *** Assertion failure in -[UICollectionViewData layoutAttributesForDecorationViewOfKind:atIndexPath:] HOT 1
- IBPCollectionCompositionalLayoutSolverResult is empty and crashed HOT 1
- Release v0.6.8
- Mistake.
- Fatal error when passing data between view controllers using prepare for segue HOT 1
- visibleCells is empty in iOS 12 HOT 2
- [New Feature Request] Add New Feature in iOS 14 HOT 2
- Generic dataSource.
- [Crash] Any UICollectionLayoutSectionOrthogonalScrollingBehavior except .none cause crash on iOS 11 HOT 2
- Group. ContentInsets iOS12 in the bottom and the trailing cannot properly HOT 3
- [Crash in Swift] When 'debugPrint(visibleItems.first?.indexPath)' in the block of visibleItemsInvalidationHandler HOT 4
- the key define is NSString, here is use NSIndex of key. how reuse this case?
- [Crash]Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'no UICollectionViewLayoutAttributes instance for -layoutAttributesForDecorationViewOfKindOfKind:
- [Crash] Thread 1: EXC_ARITHMETIC (code=EXC_I386_DIV, subcode=0x0)
- collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) is unexpected
- how to inhert from the layout
- Any update on this repository?
- interItemSpacing issue for nested group HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ibpcollectionviewcompositionallayout.