Here is the answer 👇 that I got for the same question on stack overflow, I marked it as "Validated" ✅ :
This is an iOS bug. The value
property of the stepper set in the storyboard is not honored unless the minimum value is set to 0.
For example, if you setup the stepper in the storyboard with a min value of 0, a max value of 100, a value of 50, and a step of 1, then when the view controller loads, the stepper will show a value of 50 as expected.
But if you change the min value to 1 and leave everything else the same, then the value will show as 1 instead of 50 when the view controller loads.
The simple work around is to set the initial value in code.
override func viewDidLoad() {
super.viewDidLoad()
sizeStepper.value = 40 // work around iOS bug
// Sets the first UI's display
showSizeValue()
}
Here is the link 🔗 to the answer: https://stackoverflow.com/a/75738819/16067048