what is the difference heightForRowAt vs estimatedHeightForRowAt?

Viewed 6069

Normally when i want set my row height then set

 func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 300
    }

what is the benefited with estimatedHeightForRowAt when should i use it.

update! if i want to set estimatedHeightForRowAt:

 func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {

        return // what should i put here
    }

UPDATE:
Is there any effect tableview scrolling if i provide as my wish estimatedHeightForRowAt? . for example i give in estimatedHeightForRowAt 500

2 Answers
Related