Initializer
init(_:value:formatter:onEditingChanged:onCommit:)
Creates an instance which binds over an arbitrary type, T
.
Declaration
宣言
Available when Label
is Text
.
Label
がText
である時に利用可能です。
Parameters
パラメータ
titleKey
The key for the localized 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 T
. In the event that formatter
is unable to perform the conversion, binding.value
isn’t modified.
onEditingChanged
The action to perform when the user begins editing text
and after the user finishes editing text
. The closure receives a Boolean value that indicates the editing status: true
when the user begins editing, false
when 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.
See Also
参照
Creating a Text Field with a Value