How To Change Keyboard Type In SwiftUI

SwiftUI has a new TextEditor and old TextField for user inputs.

Be default they have a standard keyboard. However, if you want to switch to another like numeric, email, or twitter keyboard you can do it.

There is .keyboardType view modifier that takes one of few possible options.

TextEditor(text: $text)

Other possible options are:

-alphabet – deprecated