init(_:value:formatter:onEditingChanged:onCommit:)
Create an instance which binds over an arbitrary type, V.
Declaration
nonisolated init<S, V>(_ title: S, value: Binding<V>, formatter: Formatter, onEditingChanged: @escaping (Bool) -> Void, onCommit: @escaping () -> Void) where S : StringProtocolParameters
- title:
The title of the text field, describing its purpose.
- value:
The underlying value to be edited.
- formatter:
A formatter to use when converting between the string the user edits and the underlying value of type
V. In the event thatformatteris unable to perform the conversion,binding.valueisn’t modified. - onEditingChanged:
The action to perform when the user begins editing
textand after the user finishes editingtext. The closure receives a Boolean value that indicates the editing status:truewhen the user begins editing,falsewhen they finish. - onCommit:
An action to perform when the user performs an action (for example, when the user presses the Return key) while the text field has focus.