Created
April 16, 2018 12:24
-
-
Save cozzin/d767c61cd2e0a09aca707eecc1df72eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UITableView { | |
func reloadDataAndKeepOffset() { | |
let offset = contentOffset | |
reloadData() | |
layoutIfNeeded() | |
setContentOffset(offset, animated: false) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment