Skip to content

setContentOffset/scrollRectToVisible works unexpected after infinite scroll handler invoked at least once #76

@Aft3rmathpwnz

Description

@Aft3rmathpwnz

The same behaviour can be noticed in demo app: add leftNavBarItem "Up", which will handle tap as
tableView.setContentOffset(CGPoint(x: 0, y: -tableView.contentInset.top), animated: true)
for example. Scroll by finger to bottom, wait till fetching will be completed, then tap "Up" button and you will end up with messed contentOffset. When I was debugging this in my project I noticed that swizzled method pb_setContentOffset wasn't logging last values, i.e. contentSize was (375, 12000), contentOffset was (0, 6000), after setContentOffset (or scrollRectToVisivle with (0,0,tableView.frame.size.width, 1.0)) final log in pb_setContentOffset was like ±600, and it was the exact position according to View Debugger. Second tap when have an offset of 600 is driving contentOffset to be correct. Any thoughts or workarounds?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions