Introduction
DiffableTextField(value: $optional, style: .number.suffix(optional != nil ? “ items” : “”))
Styles such as the one above (that depend on the input/output value) resolve changes between some and none in two steps, and sometimes two frames. While somewhat difficult to notice, it is also difficult to unsee. It is less than ideal and can easily be fixed.
Proposal
When the value changes, wait for it to stabilize before applying any downstream changes.
Alternatives
A) Conditional single-pass modifiers, like nonblankSuffix(_:) (more options/complexity).
Introduction
Styles such as the one above (that depend on the input/output value) resolve changes between
someandnonein two steps, and sometimes two frames. While somewhat difficult to notice, it is also difficult to unsee. It is less than ideal and can easily be fixed.Proposal
When the value changes, wait for it to stabilize before applying any downstream changes.
Alternatives
A) Conditional single-pass modifiers, like
nonblankSuffix(_:)(more options/complexity).