1

After using

beginUpdates()
endUpdates()

This method ->

tableView.setContentOffset(_, animated:) // do not work

Do not work after calling that 2 methods (even if I use timer), but works without them! Any ideas why?

setContentOffset works only if I swipe tableView manually after beginUpdates() + endUpdates() and BEFORE setContentOffset is being called.

scrollToRowAtIndexPath works fine though but I need only setContentOffset.

bodich
  • 1,708
  • 12
  • 31

1 Answers1

0

tableView.setContentOffset(_, animated:) works now when I calling with a dispatch to the main thread! So,

beginUpdates()
endUpdates()

DispatchQueue.main.async {
    tableView.setContentOffset(CGPoint(x: 0, y: -offset), animated: true)
}

This way works.

bodich
  • 1,708
  • 12
  • 31