uitableview - Reload table view but don't move the viewport iOS -


i have table view updated based on results api. table view has large custom cell takes half of screen. cells can ordered user custom button. in average have between 10-15 cells inside table , big issue when user clicks move bottom cell 1 point reloaddata refresh entire table , move view port top meaning user have scroll end again terrible user experience. there way refresh table view keeping position before reload or useful consider using custom scroll called after table populated. i'm writing application in swift, apis handled using alamofire, custom cell has separate xib file , table view inside view controller.

save contentoffset restore after reloaddata

let contentoffset = tableview.contentoffset  tableview.reloaddata()  tableview.contentoffset = contentoffset 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -