Tokopedia Feb 15, 2022

Implementing iOS Collection View with Efficient Rendering Mechanism

Article Summary

Tokopedia's iOS team was crashing on UICollectionView batch updates. Their solution? Build a better abstraction inspired by Instagram and SwiftUI.

The engineering team at Tokopedia faced performance issues with dynamic layouts using UICollectionView's performBatchUpdates. Wrong indexPaths caused crashes, and reloadData was too slow for complex UIs with hundreds of cells.

Key Takeaways

Critical Insight

ListNode abstracts away the complexity of performBatchUpdates by automatically calculating cell changes through diffing, making ASCollectionNode as simple to use as SwiftUI's List.

The article includes visual examples of three diffing scenarios and links to their detailed patent documentation on the implementation process.

Recent from Tokopedia

Related Articles