-
-
Save nickkaczmarek/6471564790bb27ae5cf3685ec30f7990 to your computer and use it in GitHub Desktop.
Snapping UISlider in Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class SnappingSlider: UISlider { | |
override var value: Float { | |
set { super.value = newValue } | |
get { | |
return round(super.value * 1.0) / 1.0 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment