Daily iOS
UIKit

UICollectionView internals

Why use UICollectionView instead of UITableView? Explain it in terms of the internal structure: the layout object, attributes, and reuse.

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

A collection view is a container that separates what to show (dataSource) from where to put it (UICollectionViewLayout). The layout object computes layoutAttributes for each item, and the collection view materializes only the attributes in the visible region as cells and reuses them.

Share a question