~/talk

UICollectionViewLayout from scratch

Talkat Mobius 2024 Spring · 2024-05-23..06-01· [ios]
links:none on file
slides:none on file

Shows how a production-grade custom UICollectionViewLayout is implemented for VK Market: a single layout supports floating headers and section backgrounds, adaptive column counts for phones and tablets, decorative views, custom insert/delete animations and controlled scrolling to precise offsets. Demonstrates the pitfall of recomputing all frames (huge FPS drop) and the fix: prepare()-based caching and use of invalidation contexts plus prepareForCollectionViewUpdates/finalize to recompute only changed items, yielding smooth scrolling and working animations.

AI-written summary · about

  1. 0:00Introduction
  2. 1:48What is UICollectionView
  3. 3:35Talk outline
  4. 4:17Why use Collection View
  5. 5:41Flow Layout limits
  6. 7:46Compositional Layout
  7. 9:31UICollectionViewLayout from scratch
  8. 12:58Simple layout creation
  9. 15:04Cell frame calculation
  10. 18:15Frames depend on content
  11. 20:29Performance issues
  12. 21:53prepare method role
  13. 23:20Section background
  14. 25:31Floating header
  15. 28:04Header animation issues
  16. 29:29UICollectionViewLayoutInvalidationContext
  17. 33:06Custom invalidation context
  18. 36:01Optimize attribute recalc
  19. 38:30Insert and delete items
  20. 41:02Prepare for update
  21. 42:44Finalize updates
  22. 43:48Scroll management
  23. 45:40Cell appearance animation
  24. 47:05Cell deletion animation
  25. 47:28Resources and materials
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.