|
Hallo, I am trying to write a slightly generic view for user to enter weights in different units (there is a textfield and picker for the units), but I am not able to pass in the data in correct format. Can you please advise on how to resolve this?
The error I get is: thank you for any help, I am sure there has to be an elegant way how to do this but I could not find one. |
|
You can't just pass a value directly into the
Check out this page regarding the error message, and this page explaining two-way bindings. |
|
@njansari thank you for the answer, however it does not work either. The error message is now
|
|
You must have changed something else in your code because when I run your original code with the changes I suggested, everything compiles and I do not see you new error message. Having looked at your new error message, though, it seems you may have wrapped one of your measurement properties in a |
|
Sorry, you are probably right. I was experimenting a lot... I have resolved the issue now, thank you! |
SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.