Prevent UITableView From Scrolling During Updates

priore Feb 2nd, 2018 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let lastScrollOffset = tableView.contentOffset
  2. tableView.beginUpdates()
  3. tableView.endUpdates()
  4. tableView.layer.removeAllAnimations()
  5. tableView.setContentOffset(lastScrollOffset, animated: false)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand