Hi Sam NZ,
Sounds very frustrating for you, like it has been for me.
I found that using
TextField("1.234", value: $dividend.value, format: .number)
in place of
TextField("1.234", value: $dividend.value, formatter: decimalFormatter)
has resolved the issue for me so far. It does not allow for the same control over the value as the NumberFormatter does,
let df = NumberFormatter()
df.locale = Locale.current
df.numberStyle = .decimal
df.generatesDecimalNumbers = true
return df
}()```
but at least allows for the value to be received.
Post
Replies
Boosts
Views
Activity
@Claude31 one more thing that is different, is that I just recently updated to iOS 15.4 and cannot rule this out as having an impact.
Not sure what is happening with the code
Hi Claude31,
Thanks for your advice, I will scale images on my next topic.
It does not take the input or it is not properly formatted ?
It does not take the input, use it in the form or save the values on save.
What input do you enter ?
You enter the quantity, value and fees. You can change the date using the picker.
What do you get ?
I get a record (in an array) that contains nil values for the quantity, value and fees, even though they are entered in the form.
What did you expect ?
I expect the same outcome I get when I enter the values in the app when installed by Xcode. The class object of Dividend to contain the values entered into the form.
Here is the code, I'm sure it could be refactored to be easier to read.
Any suggestions on how best to add the code?