Sergey asks:
Without Paul telling us in the lesson how could we learn what type of parameters does TextField accept?
Excellent question!
This is a great lesson for new Swift and SwiftUI programmers. You are progressing from the "show me what to do" phase to the "how can I do this on my own?" phase. Nice!
This is the time for you to learn about SwiftUI documentation.
Here's a link to the documentation about TextField:
Text Field Documentation
It might feel painful, but this is a critical skill to learn.
Scroll throught this documentation until you find the section named "Initializers".
You should see there are several ways to initialize a TextField.
@twostraws used this one:
init<V>(LocalizedStringKey, value: Binding<V>, formatter: Formatter)
Create an instance which binds over an arbitrary type, V.
Available when Label is Text.
While in the documentation, if you click on this initializer, you'll see more documentation. This is where you'll see what types of formatters are allowable.
You can follow the Formatter
documentation to learn about those! Number formatters, date formatters, measurement formatters, etc.
Read More about Formatters
I would guess that very few Swift programmers have memorized all the methods, and all the options. Consequently, you'll need to learn how to navigate and read the online documentation.