Is it possible to scroll to a particular uitableview row using scrollToRow(at: , at: , animated:) if that uitableview row is not loaded yet. If yes then how can I achieve this. If no then is there any workaround.
Asked
Active
Viewed 278 times
0
-
You can scrollToRow(at: , at: , animated:) after loaded only. – Nikunj Kumbhani Aug 28 '18 at 07:05
-
This may help - https://stackoverflow.com/questions/28043632/auto-scrolling-to-a-cell-with-a-specific-value – teja_D Aug 28 '18 at 07:22
-
Actually I know which row to scroll to but that row is not loaded yet – Prajit Aug 28 '18 at 07:31
-
You can also use setContentOffest if you know all rows heights, then you can calculate desired row y position – Ali Moazenzadeh Aug 28 '18 at 07:34
-
You can scroll to any IndexPath but point to remember is that its row index should not be more than size of array otherwise you will get exception. – Vikky Aug 28 '18 at 07:34
1 Answers
0
after table data loaded, call tableView.scrollToRow(at:, at: , animated:) and reload the table view

Oshitha Wimalasuriya
- 431
- 6
- 11