I want to add textContentType to my Sign Up page for users. It was not working correctly on my code when I run it on my phone running iOS 18.2, Xcode 16.2, and I have iCloud Keychain. The email and first name works, but when I click last name it shows email. Password and verify password does not show password suggestion.
Here is a simple view that replicates the issue.
import SwiftUI
struct ContentView: View {
@State private var emailAddress: String = ""
@State private var firstName: String = ""
@State private var lastName: String = ""
@State private var password: String = ""
@State private var verifyPassword: String = ""
var body: some View {
VStack {
Form{
TextField("email", text: $emailAddress).textContentType(.emailAddress)
TextField("firstname", text: $firstName).textContentType(.givenName)
TextField("lastname", text: $lastName).textContentType(.familyName)
SecureField("password", text: $password).textContentType(.newPassword)
SecureField("verifypassword", text: $verifyPassword).textContentType(.newPassword)
}
}
.padding()
}
}
#Preview {
ContentView()
}