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

topY position #3

Closed
rhunt222 opened this issue Nov 7, 2018 · 2 comments
Closed

topY position #3

rhunt222 opened this issue Nov 7, 2018 · 2 comments

Comments

@rhunt222
Copy link

rhunt222 commented Nov 7, 2018

I'm trying to set my topY to be a little bit higher on the screen.

When setting it to:
UIScreen.main.bounds.height * 0.10
It moves up great and the table scrolls, however when I change to:
UIScreen.main.bounds.height * 0.05
The bottom sheet moves up to my ideal position but the tableview will no longer scroll. I'm assuming I have to adjust something in the handlePan func?

@OfTheWolf OfTheWolf reopened this Nov 8, 2018
@OfTheWolf
Copy link
Owner

topY = UIScreen.main.bounds.height * 0.05 is 33.350000000000001 on iphone 8 and parentView.minY = 33.350000000000002 somehow. in fact they must be the same in top position. So the logic assumes never reached the top so sets tableview contentOffset to zero which stops scrolling. So rounding the initial value solves the problem.

//Better to set this in viewWillAppear
self.topY = round(UIScreen.main.bounds.height * 0.05)

OfTheWolf added a commit that referenced this issue Nov 8, 2018
jumping while dragging from top to down is fixed
some comments are added for initial parameters
@rhunt222
Copy link
Author

rhunt222 commented Nov 8, 2018

Thanks! Was just printing out these numbers and noticed the same. Rounding definitely works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants