Задержка производительности 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
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

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