neoneye / SwiftyFORM

iOS framework for creating forms
MIT License
1.07k stars 87 forks source link

Min/Max for Stepper #59

Closed justdan0227 closed 3 years ago

justdan0227 commented 3 years ago

Do we have the ability to set min and max for a StepperFormItem?

neoneye commented 3 years ago

There is no parameters for setting min/max values. How do you want the api for this to be like?

There is a syncCellWithValue callback where the value can be clamped.

justdan0227 commented 3 years ago

Would be awesome if you could set a min/max like you do with

instance.submitValidate(CountSpecification.min(5), message: "Zipcode must be 5 numbers")

so maybe instance.minLimit(1) instance.maxLimit(5) ?

neoneye commented 3 years ago

IMHO steppers are for tiny values. For a 5 digit zipcode, perhaps use sheet with a number textfield, showing live the name of the area corresponding to the zipcode.

gw-dkardell commented 3 years ago

Thanks I was using a stepper for a review rating of 1-5