Reputation: 4743
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
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
Reputation: 36782
you could try this:
TextField("\("[email protected]")", text: $email)
or this:
TextField("", text: $email, prompt: Text(verbatim: "[email protected]"))
Upvotes: 7