You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was watching the latest WWDC and they had a section called "A Tour of UICollectionView". In this section, the instructor creates a mosaic layout like yours by creating a subclass of UICollectionViewLayout just like TRMosaicLayout. Yet the instructor optimizes the layout for scrolling within the layoutAttributesForElements by changing the method from a linear search to a binary. Binary searches are somewhat new to me, so after rewatching the video and doing some research, I found the collection needs to be sorted to be able to run a binary search. My problem is I get a bit confused on how to create the binary search and if your cachedCellLayoutAttributes are sorted already. In the video the instructor says the cachedCallLayoutAttributes are sorted by there frames minimum y value, yet when i debug cachedCellLayoutAttributes it seems that the there frames minimum y value isn't sorted. If you have any ideas or if its even worth doing in the first place let me know. I'll add video link and specific time of video below.
I was watching the latest WWDC and they had a section called "A Tour of UICollectionView". In this section, the instructor creates a mosaic layout like yours by creating a subclass of UICollectionViewLayout just like TRMosaicLayout. Yet the instructor optimizes the layout for scrolling within the layoutAttributesForElements by changing the method from a linear search to a binary. Binary searches are somewhat new to me, so after rewatching the video and doing some research, I found the collection needs to be sorted to be able to run a binary search. My problem is I get a bit confused on how to create the binary search and if your cachedCellLayoutAttributes are sorted already. In the video the instructor says the cachedCallLayoutAttributes are sorted by there frames minimum y value, yet when i debug cachedCellLayoutAttributes it seems that the there frames minimum y value isn't sorted. If you have any ideas or if its even worth doing in the first place let me know. I'll add video link and specific time of video below.
https://developer.apple.com/videos/play/wwdc2018/225/
Specific time about optimization within layoutAttributesForElements: 25:40 -> 28:00
The text was updated successfully, but these errors were encountered: