Skip to content

Instantly share code, notes, and snippets.

@cumanzor
Created June 6, 2016 03:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cumanzor/89f4fdd1fa77a84ec4627bb5a9c67e40 to your computer and use it in GitHub Desktop.
Save cumanzor/89f4fdd1fa77a84ec4627bb5a9c67e40 to your computer and use it in GitHub Desktop.
stepped UISlider.
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
}
@cumanzor
Copy link
Author

cumanzor commented Jun 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment