Как рекомендуется работать с измерениями длины (Text, TextFields)? ⇐ IOS
Как рекомендуется работать с измерениями длины (Text, TextFields)?
I'm working on an application that allows length entries by user and switching preferred units for this in settings. It appears that official Measurement provided by swift is best option for this. It also looks like it is storable in SwiftData, which is ideal.
However, relying on Measurement works nice up until it needs to be "worked on" i.e. allowing user to edit the value in TextFields with say numeric formatting. Swift starts creaming when providing Measurment as a @Binding for example.
Before taking a route of conversion and adding additional variables to store intermediate values between Storage and editing of such data, I figured I'd ask here if there are more simple / recommended ways of working with such data.
Источник: https://stackoverflow.com/questions/780 ... textfields
I'm working on an application that allows length entries by user and switching preferred units for this in settings. It appears that official Measurement provided by swift is best option for this. It also looks like it is storable in SwiftData, which is ideal.
However, relying on Measurement works nice up until it needs to be "worked on" i.e. allowing user to edit the value in TextFields with say numeric formatting. Swift starts creaming when providing Measurment as a @Binding for example.
Before taking a route of conversion and adding additional variables to store intermediate values between Storage and editing of such data, I figured I'd ask here if there are more simple / recommended ways of working with such data.
Источник: https://stackoverflow.com/questions/780 ... textfields
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение