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
Post a Comment