yonat / MultiSlider

UISlider clone with multiple thumbs and values, range highlight, optional snap intervals, optional value labels, either vertical or horizontal.
MIT License
494 stars 113 forks source link

SwiftUI slider implementation is not displayed correctly on iOS 16.1 simulator #103

Closed kuzomenskyi closed 6 months ago

kuzomenskyi commented 7 months ago

Description of the problem: I have added the slider on SwiftUI view but the view is not displayed correctly. The one thing displayed is the blue line, instead of the whole interface. It works fine with UIKit though.

Minimal project that reproduces the problem (so I'll be able to figure out how to fix it): I have created the project specifically to reproduce the bug. Here is the link: https://github.com/kuzomenskyi/MultiSliderIsNotDisplayedCorrectly

Here is how it looks like on Xcode Preview:

Screenshot 2024-04-11 at 11 23 01 AM

Here is how it looks like on Simulator:

Screenshot 2024-04-11 at 11 23 07 AM
kuzomenskyi commented 7 months ago

Turns out that not only minimumValue and maximumValue should be provided with appropriate values, but the same is right for the value binding itself, which was not clear for me after reading the documentation.

So I have forked the repo and created the pull request. Please, consider merging it: https://github.com/yonat/MultiSlider/pull/104

Thanks!

yonat commented 6 months ago

True, if you set empty value, it means zero thumbs will be shown - this is the expected behavior.