3lvis / Form

The most flexible and powerful way to build a form on iOS

Home Page:http://hyper.no

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reset to JSON defaults

jeffleeismyhero opened this issue · comments

Presently, the reset method in FORMDataSource sets all values to nil. Do we have a way of resetting to the default values provided in the JSON?

@jeffleeismyhero Hi Jeffrey, currently we don't have such functionality. As you can see, values are only introduced to the FORMData values dictionary and then they get forgotten. You could probably store this values for later usage and have a method like restoreToInitialValues or just restore.

https://github.com/hyperoslo/Form/blob/c84d5264e48224c2e718bef4751fedadd9875edb/Source/FORMData.m#L40

I remember we also stored the initial values in a dictionary in our app and when the Reset button was pressed, we should send this values to reloadWithDictionary.

I think this issue might be fixed, please @jeffleeismyhero scream if this is incorrect.