Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reachedBottomPublisher offset not working as expected. #89

Open
markst opened this issue Nov 30, 2023 · 2 comments
Open

reachedBottomPublisher offset not working as expected. #89

markst opened this issue Nov 30, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@markst
Copy link

markst commented Nov 30, 2023

Appears the UIScrollView.reachedBottomPublisher offset is not working as expected.

Currently the threshold is calculated by using max bracketing on offset of calculating the y to compare using visible height:

let threshold = max(offset, self.contentSize.height - visibleHeight)

However in order for this to work the publisher would have to be setup as:

collectionView
  .reachedBottomPublisher(collectionView.contentSize.height - visibleHeight - offset)
  .sink {

Which I don't believe is correct given when dynamically inserting content the content size will change.

@markst markst added the bug Something isn't working label Nov 30, 2023
@markst
Copy link
Author

markst commented Nov 30, 2023

I believe the threshold needs to be calculated considering the offset such as:

let threshold = (self.contentSize.height - visibleHeight) - offset

@markst
Copy link
Author

markst commented Dec 18, 2024

@freak4pc - are you happy to add us to as a maintainer to this repo as you don't need to be maintaining this repo? It's last merge was two years ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant