The following code:
struct ContentView: View { @State private var email = ""
var body: some View {
VStack {
TextField("email", text: $email)
.textContentType(.emailAddress)
}
}
}
does not work as expected. What I expected is to run the app and have it suggest my actual email when I click into the field. Instead what it does is display "Hide My Email" twice. Selecting the first "Hide My Email" pastes the actual text "Hide My Email" into the field, the second one brings up an iCloud sheet to select a random email.
Trying some suggestions online for .emailAddress in general not working does not change anything:
TextField("Email", text: $email) .textFieldStyle(RoundedBorderTextFieldStyle()) .textContentType(.emailAddress) .keyboardType(.emailAddress) .autocorrectionDisabled() .disableAutocorrection(true) .textInputAutocapitalization(.never)