How can I use UIStepper
as simple increaser/decreaser?
The only way I've found is to set the value of the UIStepper
to 1 each time I detect an action and compare the value to 1 when I catch an action:
@IBAction func onStepperValueChangedAction(sender: UIStepper) {
if sender.value > 1 {
increaseValue()
} else {
decreaseValue()
}
sender.value = 1
}
Don't forget to set the default value of the UIStepper
to 1.