We had some crashes in production on one of our apps, took us a while to figure this out.
Scenario: we have a UICollectionView with a searchBar that filters out a list of items fetched from CoreData (I mean, data is local and there is no network involved, it's some kind of "quick-fetch") .
On the right, of course we have BDKCollectionIndexView. When user query for some of the ingredients in the list, the indexView gets updated correctly. If the user types in a query with NO match, the indexView also gets updated correctly (no indexes at all), but if the user is still scrolling inside the indexView, the handleGesture method keeps on calling setNewIndexForPoint:(CGPoint)point method.
Solved by adding
We had some crashes in production on one of our apps, took us a while to figure this out. Scenario: we have a UICollectionView with a searchBar that filters out a list of items fetched from CoreData (I mean, data is local and there is no network involved, it's some kind of "quick-fetch") . On the right, of course we have BDKCollectionIndexView. When user query for some of the ingredients in the list, the indexView gets updated correctly. If the user types in a query with NO match, the indexView also gets updated correctly (no indexes at all), but if the user is still scrolling inside the indexView, the handleGesture method keeps on calling
setNewIndexForPoint:(CGPoint)point
method. Solved by addingif (self.indexLabels.count<1) return;
at line 274 of BDKCollectionIndexView.m
Going to submit you a Pull Request ASAP