-
Notifications
You must be signed in to change notification settings - Fork 27
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
Landscape Option #1
Comments
Hey, @dhruveshah. Thanks. |
@LeonardoCardoso Would I simply be able to rotate the view to get it in landscape? or would I have to go into the code and swap the heights and widths that are being set? |
I don't think this would work because the dragging is calculated by the view's height. But if you change that in the code might work. |
Hey @LeonardoCardoso |
@dhruveshah What lines have you changed? |
@LeonardoCardoso I changed quite a lot so it uses the width instead of the height. First, at the top, I changed on line 21, the On line 37, I changed from Then, I changed the Then in In the I then changed the Lastly, in the function, touchedX, I swapped it from:
to
|
I'll take a look when I have more time. I have to rethink that. |
@LeonardoCardoso So, I found a "rough working solution". Probably not the best way to get it working, but I changed the following and it seems to work. I'm sure there is a more elegant solution that can be derived from this
and changed |
@dhruveonmars, @LeonardoCardoso, this is 2 years late, but I put together a version of this sectioned slider myself. Along with some minor improvements, my version allows you to initialize the I might make it its own page at some point, but for now the code is here. All you have to do is copy the file into your project. If it doesn't help you, hopefully it helps someone else passing through this thread. |
@danielVebman I think you forgot to call the delegate. Add this to the end of your if gesture.state == .ended {
delegate?.sectionedSlider(self, selected: value)
} Also you should always declare protocols as a class type and make the delegate a weak var. Apart from that your version worked fine for me. Thanks a bunch! 🍻 |
Hey, I love that someone came out with this.
I was wondering if you plan on, or could add an option to use it in Landscape rather than in Portrait only.
The text was updated successfully, but these errors were encountered: