-
-
Save HamGuy/bab0a5d1e63bac7bbc6361dc48059e1b to your computer and use it in GitHub Desktop.
stepped UISlider.
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
let step: Float = 50; | |
// extra slider initialization. the IBAction func below points to the UISlider we are using. | |
@IBAction func onStrengthChange(sender: UISlider) { | |
let roundedValue = round(sender.value/step) * step | |
sender.value = roundedValue | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment