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

After using


beginUpdates()

endUpdates()


->


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? Looks like a bug(((


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.

Accepted Reply

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


What do you mean:

- offset does not occur ?

- animation does not show ?


Do you call with animated true or false ? Try changing the parameter.

Did you try calling with a doipsatch to the main thread ?

=> Please, show the code where you call the method.


May read this:

https://stackoverflow.com/questions/46660347/uiscrollview-setcontentoffsetanimated-not-working-in-ios11?rq=1

Replies

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


What do you mean:

- offset does not occur ?

- animation does not show ?


Do you call with animated true or false ? Try changing the parameter.

Did you try calling with a doipsatch to the main thread ?

=> Please, show the code where you call the method.


May read this:

https://stackoverflow.com/questions/46660347/uiscrollview-setcontentoffsetanimated-not-working-in-ios11?rq=1

Wooooow, thank you sooo much!

It works now when I try calling with a dipsatch to the main thread!


It worked without dispatching without beginUpdates().

Answering your questions, both:


- Offset did not occur

- Animation does not show


*** now it works))