byaruhaf
byaruhaf

Reputation: 4743

In iOS16.4 Email inside TextField prompt rendered blue

After upgrading to Xcode Version 14.3, the TextField prompt in iOS 16.4 is rendered blue not gray as it was in iOS 16.3

struct ContentView: View {
    @State var email: String = .init()
    var body: some View {
        VStack {
            TextField("[email protected]", text: $email)
        }
        .padding()
    }
}

Upvotes: 2

Views: 558

Answers (2)

Nikolay Solovyov
Nikolay Solovyov

Reputation: 192

TextField("account\u{200B}@email.com", text: $email)

\u{200B} is a zero-width space, which breaks the email address regex.

Upvotes: 2

you could try this:

TextField("\("[email protected]")", text: $email)

or this:

TextField("", text: $email, prompt: Text(verbatim: "[email protected]"))
     

Upvotes: 7

Related Questions