How to read text from a TextField - SwiftUI by Example

preview_player
Показать описание
SwiftUI’s TextField view is similar to UITextField, although it looks a little different by default and relies very heavily on binding to state.
Рекомендации по теме
Комментарии
Автор

Questions? Comments? Tweet me @twostraws.

twostraws
Автор

Can you show how a user could "tab" through multiple textfields by hitting the return key on the keyboard in SwiftUI. Sp if there are lets say 5 textfields, user click in the first one, enters text and hit return, it should tab to the second textfield and so on and so forth.

pickemparty
Автор

Hi Paul. Your videos and examples on Hacking with Swift are simply TOP!! Thank you. Regarding Textfields I have noticed there is a possible bug when binding a Double value. Unless you tap on submit on the keyboard, the typing is never picked up.

cristianopalazzini
Автор

The syntax has been changed. Now you need to type: TextField("PlaceholderText", text: $name)

legolas
Автор

This solution not working when you try to make two input fields, turn on voice over and try to type something to both fields. And now you are in trap: because you can't to switch focus from one field to another.
PS: the magic happens when you change container type from VStack to Form. Probably this is apple's SwiftUI bug, I didn't find any workaround.

AlexCopter
Автор

How to change to accept just numbers? I mean when click appears just the number keyboard

raymundoortiz
Автор

Hello, how to dismiss keyboard in swiftUI? Tell me please

alexvolkov
Автор

fine.. but now use Core Data and watch xcode begin to cry

namelastname
welcome to shbcf.ru