I was trying to “prescroll” a UITableView before showing it to the user. I initially tried doing it in “viewWillAppear:”:
It works when I was trying to “prescroll” to Row 7, however, the result is not satisfactory when scrolling a bit more downward. I tried “prescrolling” to Row 18 (the last row), and it does not scroll to the correct position:
Then I tried “prescrolling” in “viewDidAppear:”:
Using this method, Row 18 scrolls to the correct position, but the user sees the whole “scrolling process”:
How to “prescroll” to the correct indexPath you wish, without letting the user see the whole “scrolling process”? I figured out a way to do it, which is scrolling in “viewDidLayoutSubviews” with a Bool flag: