Challenge
cellForRow has:
16msto execute in a60hzscreen device8msin a 120hz screen device
If the function takes longer than that, the app fps (and user experience) will drop.
Solution
From iOS 10 we have a prefetch data function (that runs in the background) which helps us fetching the data before it being required to be displayed in a cell:
// UITableView Pre-Fetching
protocol UITableViewDataSourcePrefetching {
func tableView(_ tableView: UITableView, prefetchRowsAt indexPaths: [IndexPath])
func tableView(_ tableView: UITableView, cancelPrefetchingForRowsAt: indexPaths [IndexPath])
}Improvements Under The Hood
Beside the prefetching above, this session goes deep into a lot of system improvements (cpu, different threads management, auto layout).
