Задержка производительности SwiftData при привязке значений модели к текстовому полюIOS

Программируем под IOS
Гость
Задержка производительности SwiftData при привязке значений модели к текстовому полю

Сообщение Гость »


I have a list of cells which take a model as a

Код: Выделить всё

Bindable
and then bind properties of that model to textfields. The problem is that typing into a textfield is incredibly laggy as I assume the value is instantly updated (e.g.

Код: Выделить всё

TextField("0", value: $reps, format: .number)
as I am binding the value directly to a property of my object. I have tried to use variables instead, but then I need to manually save the edited values with the

Код: Выделить всё

onDisappear
view modifier; the performance when typing in the textfields is good with this approach but scrolling the list becomes extremely laggy. Is there any other solution that could work?


Источник: https://stackoverflow.com/questions/781 ... -textfield

Вернуться в «IOS»