I should add that this is not working when the Textfield is in .sheet or .fullScreenCover
Post
Replies
Boosts
Views
Activity
The only workaround that works for me is to remove the @Published property from a variable like so:
import Foundation
class TestFloatViewModel: ObservableObject {
@Published var testFloat = TestFloat()
}
This is not ideal because the view is not updated if I need the view to update when this variable is updated (if I don' need this variable to control/impact view updates, then it is less of a problem).
I applied this workaround because I need users to enter the data in a correct format, but I really don't understand why the original code is not working with iOS 17...
Apologies, the code above should read:
import Foundation
class TestFloatViewModel: ObservableObject {
var testFloat = TestFloat()
}