Keyboard Types & Placeholders
Configure keyboard, prompt, and submit behavior.
Shape the Input
A bare TextField accepts anything. With a few modifiers you can shape the keyboard, the hint, and what happens on submit. ⌨️
Choosing a Keyboard
The keyboardType modifier picks which on-screen keyboard appears. An email field deserves the email layout, not the full alphabet.
TextField("Email", text: $email)
.keyboardType(.emailAddress)All lessons in this course
- Binding a TextField to State
- Keyboard Types & Placeholders
- SecureField for Passwords
- Live Input Validation