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

It's too dangerous to use too much hardcode to judge the direction of scrollView #5

Closed
EkkoG opened this issue Mar 28, 2016 · 4 comments

Comments

@EkkoG
Copy link

EkkoG commented Mar 28, 2016

As you can see,in theSwipViewController's changeButtonColor method,there are too much hard code to judge the direction of the scrollView,there are many if else things,and all of these if else do not cover all scope,you just consider the scope from -374 to 374,so how it work on iPhone 6 plus,iPhone 6 plus's screen width is 414,it is out of the scope you considered.

I think this issue maybe has a better solution,like this https://stackoverflow.com/questions/2543670/finding-the-direction-of-scrolling-in-a-uiscrollview
How about you?

@fortmarek
Copy link
Owner

The thing is just the direction won't do it since I need to change the color exactly halfway through the animation.
But it's true that the values are hardcoded, kind of didn't struck me to support there other sizes (silly me - I really should have thought of it). Will look into how to change that, thanks for the suggestion.

@EkkoG
Copy link
Author

EkkoG commented Mar 28, 2016

Yeah,this solution is a bit verbose,because you should write code for different size screen,I think the stackoverflow solution is better because you can write code once,but for all size of screen it can work well.
I'm working on a simuliar project,it also has a simuliar animation,but the project only has few customize feature
https://github.com/cielpy/CPYPagerViewController

@fortmarek
Copy link
Owner

New 0.1.1 release uses more abstract values to work with all screen sizes. I might do some more refactoring in the future but this version should do for now. Let me know if there is something specific you'd change.

@EkkoG
Copy link
Author

EkkoG commented Mar 28, 2016

Thanks

On Tuesday, 29 March 2016, Marek Fořt notifications@github.com wrote:

New 0.1.1 release uses more abstract values to work with all screen sizes.
I might do some more refactoring in the future but this version should do
for now 👍


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#5 (comment)

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