+1 to this. An approach when you use .onReceive modifier, like in example below, from the view itself also no longer works.
TextField("Total number of people", text: $numOfPeople)
.keyboardType(.numberPad)
.onReceive(Just(numOfPeople)) { newValue in
let filtered = newValue.filter(\.isNumber)
if filtered != newValue {
self.numOfPeople = filtered
}
}
Post
Replies
Boosts
Views
Activity
It says your feedback is not found. Any updates on its status?