Method estimatedHeightForRowAt is called only when we initialize UITableView.
Correct. It is called for all rows up front, so we can estimate the whole height of the table content. That is exactly what it is for.
When you scroll and the new rows are about to appear, those are now real rows with real cells in them, so now you must give the real heights!